/* ── Reset & Variables ───────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface2: #181818;
  --surface3: #1f1f1f;
  --border: #242424;
  --border2: #2e2e2e;
  --text: #e2e2e2;
  --text2: #888;
  --text3: #555;
  --text-strong: #ffffff;
  --accent: #7c6af7;
  --accent-bg: rgba(124, 106, 247, .08);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, .08);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, .08);
  --gold: #f59e0b;
  --gold-bg: rgba(245, 158, 11, .08);
  --blue: #3b82f6;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpolyline points='1,1 5,6 9,1' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --radius: 8px;
  --radius-lg: 12px;
  font-family: 'Poppins', sans-serif;
}

[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface2: #f4f6f8;
  --surface3: #eaedf0;
  --border: #e2e6ea;
  --border2: #d0d5dc;
  --text: #1a1d23;
  --text2: #5a6478;
  --text3: #8a94a6;
  --text-strong: #0f1117;
  --accent-bg: rgba(124, 106, 247, .1);
  --green-bg: rgba(34, 197, 94, .1);
  --red-bg: rgba(239, 68, 68, .1);
  --gold-bg: rgba(245, 158, 11, .1);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.5;
}

select {
  color-scheme: dark;
}

[data-theme="light"] select {
  color-scheme: light;
}

select option {
  background: var(--surface2);
  color: var(--text);
}

.pp-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pp-select {
  position: relative;
  display: inline-block;
  min-width: 140px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  color: var(--text);
  z-index: 1;
}

.pp-select.open {
  z-index: 80;
}

.pp-select--field,
.pp-select--account,
.fg .pp-select {
  width: 100%;
}

.pp-select-btn {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 32px 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 11px center;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}

.pp-select--field .pp-select-btn {
  min-height: 40px;
  background-color: var(--surface2);
  border-color: var(--border2);
  color: var(--text);
  font-size: 13px;
}

.pp-select--account .pp-select-btn {
  min-height: 32px;
  padding: 7px 30px 7px 10px;
  background-color: var(--surface2);
  color: var(--text-strong);
  font-weight: 500;
}

.pp-select-btn:hover,
.pp-select.open .pp-select-btn {
  border-color: var(--accent);
  background-color: var(--surface3);
}

.pp-select-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.pp-select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(0, 0, 0, .36);
  display: none;
}

.pp-select.open .pp-select-menu {
  display: block;
}

.pp-select-option {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}

.pp-select-option:hover,
.pp-select-option.active {
  background: var(--surface3);
  color: var(--text-strong);
}

.pp-select-option.selected {
  background: var(--accent-bg);
  color: var(--text-strong);
}

.pp-select-option.disabled {
  opacity: .45;
  cursor: not-allowed;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 2px;
}

/* ── Layout ──────────────────────────────────────── */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ── Mobile-only elements (hidden on desktop) ─────── */
.mobile-topbar, .hamburger, .mobile-signout, .nav-backdrop { display: none; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: 210px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
}

.logo-wrap {
  padding: 30px 24px 24px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.3px;
}

.logo em {
  font-style: normal;
  color: var(--accent);
}

.logo-tag {
  font-size: 10px;
  font-weight: 400;
  color: var(--text3);
  margin-top: 3px;
  letter-spacing: .5px;
}

.nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  transition: all .15s;
  margin-bottom: 4px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-item.active {
  color: var(--text-strong);
  background: var(--surface3);
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text3);
  transition: color .15s;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.nav-item:hover .nav-icon {
  color: var(--text2);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.status-dot.err {
  background: var(--red);
}

.status-text {
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
}

/* ── Main ────────────────────────────────────────── */
.main {
  margin-left: 210px;
  flex: 1;
  padding: 40px 48px;
}

/* ── Page header ─────────────────────────────────── */
.page-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.3px;
}

.page-title small {
  font-size: 13px;
  font-weight: 400;
  color: var(--text2);
  margin-left: 8px;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  letter-spacing: .2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #6a58e8;
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text3);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef444466;
}
.btn-danger:hover:not(:disabled) {
  background: #ef444415;
  border-color: #ef4444;
}
.btn-danger:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ── Danger Zone panel ───────────────────────────── */
.danger-zone {
  border-color: #ef444430;
}
.danger-title { color: #ef4444 !important; }
.danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
@media (max-width: 600px) {
  .danger-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, .25);
}

.btn-danger:hover {
  background: var(--red-bg);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 11px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon svg,
.btn svg,
.pg-btn svg,
.ss-nav-btn svg,
.pw-eye svg,
.modal-x svg,
.streak-alert-close svg,
.tag-del svg,
.ss-del svg,
.btn-theme svg,
.panel-title svg,
.tag-info svg,
.inline-empty svg,
.toast svg,
.replay-no-ss svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
  flex-shrink: 0;
}

.lb-nav svg {
  width: 30px;
  height: 30px;
  stroke-width: 1.8;
}

.btn-icon:hover {
  color: var(--text);
  border-color: var(--border2);
}

/* ── Stat cards ──────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
}

.stat-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 12px;
}

.stat-val {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-val.pos {
  color: var(--green);
}

.stat-val.neg {
  color: var(--red);
}

.stat-val.acc {
  color: var(--accent);
}

.stat-val.gld {
  color: var(--gold);
}

.stat-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
}

/* ── Panel ───────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel:has(.pp-select.open),
#accFormWrap .panel,
#accFormWrap .panel-body {
  overflow: visible;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
}

.select-col {
  width: 34px;
  text-align: center;
}

.select-col input,
.trade-select {
  width: 16px;
  height: 16px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border2);
  border-radius: 5px;
  background: var(--surface2);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}

.select-col input:hover,
.trade-select:hover {
  border-color: var(--accent);
  background: var(--surface3);
}

.select-col input:focus-visible,
.trade-select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-bg);
  border-color: var(--accent);
}

.select-col input::before,
.trade-select::before {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform .12s ease;
  margin-top: -1px;
}

.select-col input:checked,
.trade-select:checked,
.select-col input:indeterminate {
  background: var(--accent);
  border-color: var(--accent);
}

.select-col input:checked::before,
.trade-select:checked::before {
  transform: rotate(-45deg) scale(1);
}

.select-col input:indeterminate::before {
  width: 8px;
  height: 2px;
  border: 0;
  background: #fff;
  border-radius: 2px;
  transform: scale(1);
  margin-top: 0;
}

.panel-body {
  padding: 24px;
}

/* ── Grid ────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.two-eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── Charts ──────────────────────────────────────── */
.chart-box {
  height: 200px;
  position: relative;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text3);
  font-size: 12px;
  pointer-events: none;
}
.chart-empty-icon { font-size: 28px; opacity: .45; }

.chart-empty-icon svg,
.tbl-empty-icon svg,
.ss-empty-icon svg,
.empty-icon svg,
.ai-type-icon svg,
.modal-state-icon svg,
.streak-alert-icon svg {
  width: 1em;
  height: 1em;
  stroke-width: 1.8;
}

/* ── Table empty states ──────────────────────────── */
.tbl-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text3);
  font-size: 13px;
}
.tbl-empty-icon { font-size: 28px; margin-bottom: 8px; }

/* ── Screenshot grid empty ───────────────────────── */
.ss-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  color: var(--text3);
  font-size: 12px;
  gap: 6px;
}
.ss-empty-icon { font-size: 30px; opacity: .45; }

/* ── Inline empty (tags, small sections) ─────────── */
.inline-empty {
  font-size: 12px;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Table ───────────────────────────────────────── */
.tbl-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 13px 18px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}

tbody tr:hover {
  background: var(--surface2);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  font-weight: 400;
}

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .4px;
}

.b-win {
  background: var(--green-bg);
  color: var(--green);
}

.b-loss {
  background: var(--red-bg);
  color: var(--red);
}

.b-open {
  background: rgba(59, 130, 246, .1);
  color: var(--blue);
}

.b-be {
  background: var(--gold-bg);
  color: var(--gold);
}

.b-long {
  background: var(--green-bg);
  color: var(--green);
}

.b-short {
  background: var(--red-bg);
  color: var(--red);
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.gld {
  color: var(--gold);
}

/* ── Filters ─────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.f-input,
.f-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
}

select.f-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.f-input:focus,
.f-select:focus {
  border-color: var(--accent);
}

.f-select:focus {
  background-color: var(--surface2);
}

.f-input::placeholder {
  color: var(--text3);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
  color: var(--text);
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  color: var(--text);
}

input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
  color: var(--text);
}

/* ── Modal ───────────────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(3px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.overlay.show {
  display: flex;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 680px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px;
  animation: mup .2s ease;
}

@keyframes mup {
  from {
    transform: translateY(16px);
    opacity: 0
  }

  to {
    transform: translateY(0);
    opacity: 1
  }
}

.modal-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-strong);
}

.modal-x {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-x:hover {
  color: var(--text);
}

/* ── Form ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fg.full {
  grid-column: span 2;
}

.fg label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
}

.fc {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 11px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}

.fc:focus {
  border-color: var(--accent);
}

.fc::placeholder {
  color: var(--text3);
}

textarea.fc {
  resize: vertical;
  min-height: 80px;
}

select.fc option {
  background: var(--surface2);
}

.pw-wrap {
  position: relative;
}
.pw-wrap .fc {
  padding-right: 36px;
}
.pw-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 4px;
  display: flex;
  align-items: center;
  line-height: 1;
}
.pw-eye:hover {
  color: var(--text2);
}

.modal-state-icon {
  display: inline-flex;
  color: var(--accent);
  font-size: 32px;
  margin-bottom: 12px;
}

.modal-state-icon.ok {
  color: var(--green);
}

select.fc {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

select.fc:hover,
select.f-select:hover,
.acc-select:hover {
  border-color: var(--border2);
  background-color: var(--surface3);
}

.fsep {
  grid-column: span 2;
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.fcheck {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
}

.fcheck input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.f-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 28px;
}

/* ── Page sections ───────────────────────────────── */
.page {
  display: none;
}

.page.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page .panel,
.page .two-eq,
.page .two-col {
  margin-bottom: 0;
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--text3);
  font-size: 13px;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

/* ── Toast ───────────────────────────────────────── */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  animation: tin .25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .4);
}

.toast span {
  display: inline-flex;
  align-items: center;
}

@keyframes tin {
  from {
    transform: translateX(30px);
    opacity: 0
  }

  to {
    transform: translateX(0);
    opacity: 1
  }
}

.toast.ok {
  border-left: 3px solid var(--green);
}

.toast.err {
  border-left: 3px solid var(--red);
}

/* ── Detail panel ────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.d-item .d-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

.d-item .d-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.note-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 12px;
  color: var(--text2);
  line-height: 1.7;
  margin-top: 14px;
  white-space: pre-wrap;
}

.note-box .note-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}

/* ── Screenshots ─────────────────────────────────── */
.ss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ss-thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16/10;
  background: var(--surface2);
  cursor: pointer;
}

.ss-thumb:hover {
  border-color: var(--accent);
}

.ss-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ss-del {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, .75);
  border: none;
  color: var(--red);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}

.ss-thumb:hover .ss-del {
  opacity: 1;
}

.upload-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  font-size: 12px;
  color: var(--text3);
  margin-top: 14px;
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--text2);
}

.upload-zone input {
  display: none;
}

.upload-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.show {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
}

.lb-close {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 24px;
  color: var(--text2);
  cursor: pointer;
  background: none;
  border: none;
}

/* ── Spinner ─────────────────────────────────────── */
.spin {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sp .6s linear infinite;
}

@keyframes sp {
  to {
    transform: rotate(360deg)
  }
}

/* ── Heatmap ─────────────────────────────────────── */
.hm-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
  display: flex;
  align-items: flex-start;
}

.hm-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: max-content;
}

.hm-months {
  display: flex;
  padding-left: 30px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
  margin-bottom: 2px;
}

.hm-body {
  display: flex;
  gap: 3px;
}

.hm-dlabels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 4px;
}

.hm-dlabel {
  font-size: 9px;
  font-weight: 400;
  color: var(--text3);
  height: 12px;
  line-height: 12px;
  text-align: right;
  width: 26px;
}

.hm-week {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-self: flex-start;
}

.hm-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: transform .1s;
}

.hm-cell:hover {
  transform: scale(1.5);
  z-index: 5;
  position: relative;
}

.hm-cell.empty {
  background: transparent;
}

.hm-cell.none {
  background: var(--surface2);
}

.hm-cell.w1 {
  background: #14532d;
}

.hm-cell.w2 {
  background: #166534;
}

.hm-cell.w3 {
  background: #15803d;
}

.hm-cell.w4 {
  background: var(--green);
}

.hm-cell.l1 {
  background: #450a0a;
}

.hm-cell.l2 {
  background: #7f1d1d;
}

.hm-cell.l3 {
  background: #b91c1c;
}

.hm-cell.l4 {
  background: var(--red);
}

.hm-cell.be {
  background: var(--surface3);
  border: 1px solid var(--gold);
}

.hm-tip {
  position: fixed;
  z-index: 9000;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 9px 13px;
  font-size: 11px;
  pointer-events: none;
  display: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .5);
}

.hm-tip.show {
  display: block;
}

.hm-tip-date {
  color: var(--text3);
  font-size: 10px;
  margin-bottom: 3px;
}

.hm-tip-pnl {
  font-size: 13px;
  font-weight: 600;
}

.hm-leg {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text3);
}

.hm-leg-cells {
  display: flex;
  gap: 2px;
}

.hm-leg-cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ══════════════════════════════════════════════════
   P&L CALENDAR
══════════════════════════════════════════════════ */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cal-month-lbl {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  min-width: 140px;
  text-align: center;
}

.cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.cal-grid thead th {
  padding: 12px 8px 14px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text3);
  border: none;
  background: transparent;
}

.cal-grid thead th.week-th {
  width: 100px;
  color: var(--accent);
  text-align: right;
  padding-right: 8px;
}

.cal-grid tbody td {
  border: none;
  vertical-align: top;
  padding: 0;
}

.cal-week-row td {
  border-top: 1px solid var(--border);
}

.cal-day {
  min-height: 80px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  position: relative;
}

.cal-day:last-of-type {
  border-right: none;
}

.cal-day.other-month .cal-day-num {
  color: var(--text3);
  opacity: .3;
}

.cal-day.other-month .cal-day-pnl {
  display: none;
}

.cal-day.today {
  background: rgba(124, 106, 247, .05);
}

.cal-day.today .cal-day-num {
  color: var(--accent);
  font-weight: 600;
}

.cal-day-num {
  font-size: 12px;
  font-weight: 500;
  color: var(--text2);
  line-height: 1;
}

.cal-day-pnl {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.cal-day-pnl.pos {
  color: var(--green);
}

.cal-day-pnl.neg {
  color: var(--red);
}

.cal-day-pnl.zero {
  color: var(--text3);
}

.cal-day-badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 10px;
  font-weight: 400;
  color: var(--text3);
  letter-spacing: .3px;
}

/* Week total cell */
.cal-week-total {
  min-height: 80px;
  padding: 12px 16px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
}

.wt-lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 6px;
}

.wt-val {
  font-size: 14px;
  font-weight: 600;
}

.wt-val.pos {
  color: var(--green);
}

.wt-val.neg {
  color: var(--red);
}

.wt-val.zero {
  color: var(--text3);
}

/* Monthly total row */
.cal-month-total-row td {
  border-top: 1px solid var(--border2);
  padding: 28px 32px;
  background: var(--surface2);
}

.cal-month-summary {
  display: flex;
  gap: 40px;
  align-items: center;
  flex-wrap: wrap;
  padding: 20PX;
}

.cal-ms-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-ms-lbl {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
}

.cal-ms-val {
  font-size: 15px;
  font-weight: 600;
}

/* ── Playbook ─────────────────────────────────────── */
.pb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.pb-card:hover {
  border-color: var(--border2);
}

.pb-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.pb-desc {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 14px;
  line-height: 1.6;
}

.pb-rules {
  font-size: 11px;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Mobile Top Bar ───────────────────────────── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(54px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding-left: 16px;
    padding-right: 16px;
    z-index: 300;
  }

  .mobile-topbar-logo {
    font-size: 18px; font-weight: 700;
  }

  .mobile-topbar-logo em { font-style: normal; color: var(--accent); }

  .hamburger {
    display: flex; flex-direction: column;
    justify-content: center; gap: 5px;
    width: 36px; height: 36px;
    background: none; border: none; cursor: pointer; padding: 6px;
  }

  .hamburger span {
    display: block; height: 2px; border-radius: 2px;
    background: var(--accent); transition: all 0.25s ease;
    transform-origin: center;
  }

  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mobile-signout {
    font-size: 12px; padding: 6px 12px;
  }

  /* ── Sidebar → Full-screen overlay ────────────── */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0; right: auto;
    width: 80%; max-width: 300px;
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 400;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* ── Nav Backdrop ─────────────────────────────── */
  .nav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 350;
    backdrop-filter: blur(2px);
  }

  .nav-backdrop.show { display: block; }

  /* Restore sidebar internals */
  .logo-wrap { display: flex; flex-direction: column; }
  .sidebar-footer { display: flex; }

  .nav {
    flex-direction: column;
    overflow-x: unset;
    overflow-y: unset;
  }

  .nav-item {
    flex-direction: row;
    min-width: unset;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border-left: 3px solid transparent;
    border-top: none;
    margin-bottom: 2px;
    gap: 10px;
    justify-content: flex-start;
    letter-spacing: normal;
  }

  .nav-item.active {
    border-left-color: var(--accent);
    background: rgba(124,106,247,0.08);
    color: var(--accent);
  }

  .nav-icon { display: inline-flex; }
  .nav-sep { display: block; }

  /* ── Main Content ─────────────────────────────── */
  .main {
    margin-left: 0;
    padding: calc(54px + env(safe-area-inset-top, 0px)) 16px 32px;
    overflow-x: hidden;
  }

  /* ── Page top spacing below fixed topbar ─────── */
  .page {
    padding-top: 20px;
  }

  @media (max-width: 480px) {
    .page {
      padding-top: 60px;
    }
  }

  /* ── Page Header ──────────────────────────────── */
  .page-hd {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 18px;
  }

  /* ── Stat Cards: 2×3 grid ─────────────────────── */
  .stat-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .stat-card {
    padding: 14px 12px;
  }

  .stat-lbl {
    font-size: 10px;
    margin-bottom: 8px;
  }

  .stat-val {
    font-size: 18px;
  }

  .stat-hint {
    font-size: 10px;
  }

  /* ── Panels ───────────────────────────────────── */
  .panel {
    margin-bottom: 14px;
  }

  .page .panel,
  .page .two-eq,
  .page .two-col {
    margin-bottom: 0;
  }

  .page.active {
    gap: 14px;
  }

  .panel-hd {
    padding: 13px 16px 11px;
    flex-wrap: wrap;
  }

  .panel-body {
    padding: 16px;
  }

  /* ── Chart Grids: Stack ───────────────────────── */
  .two-col {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .two-eq {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .chart-box {
    min-width: 0;
  }

  .chart-box {
    height: 180px;
  }

  /* ── Filters ──────────────────────────────────── */
  .filters {
    gap: 8px;
    margin-bottom: 14px;
  }

  .f-input,
  .f-select {
    padding: 8px 10px;
    font-size: 11px;
    flex: 1;
    min-width: 120px;
  }

  .filters .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* ── Trade Log: Hide non-essential columns ────── */
  /* Keep: Date(2) Symbol(3) Dir(4) P&L(8) Status(14) */
  /* Hide: #(1) Entry(5) Exit(6) Size(7) P&L%(9) R:R(10) Setup(11) Emotion(12) 📸(13) Actions(15) */
  #tradesTblWrap thead th:nth-child(1),
  #tradesTblWrap thead th:nth-child(5),
  #tradesTblWrap thead th:nth-child(6),
  #tradesTblWrap thead th:nth-child(7),
  #tradesTblWrap thead th:nth-child(9),
  #tradesTblWrap thead th:nth-child(10),
  #tradesTblWrap thead th:nth-child(11),
  #tradesTblWrap thead th:nth-child(12),
  #tradesTblWrap thead th:nth-child(13),
  #tradesTblWrap thead th:nth-child(15),
  #tradesTblWrap tbody td:nth-child(1),
  #tradesTblWrap tbody td:nth-child(5),
  #tradesTblWrap tbody td:nth-child(6),
  #tradesTblWrap tbody td:nth-child(7),
  #tradesTblWrap tbody td:nth-child(9),
  #tradesTblWrap tbody td:nth-child(10),
  #tradesTblWrap tbody td:nth-child(11),
  #tradesTblWrap tbody td:nth-child(12),
  #tradesTblWrap tbody td:nth-child(13),
  #tradesTblWrap tbody td:nth-child(15) {
    display: none;
  }

  /* ── Table ────────────────────────────────────── */
  thead th {
    padding: 10px 10px;
    font-size: 9px;
  }

  tbody td {
    padding: 11px 10px;
    font-size: 11px;
  }

  /* ── Modal: Full-width centered ──────────────────── */
  .overlay {
    align-items: center;
    padding: 16px;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .modal-hd {
    margin-bottom: 20px;
  }

  /* ── Form: Single Column ──────────────────────── */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .fg.full {
    grid-column: span 1;
  }

  .fsep {
    grid-column: span 1;
  }

  .fc {
    padding: 10px 12px;
  }

  .f-actions {
    margin-top: 20px;
  }

  /* ── Detail Grid: Single Column ───────────────── */
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* ── Toast: Full Width ────────────────────────── */
  .toast-stack {
    left: 12px;
    right: 12px;
    bottom: 80px;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  /* ── Screenshots ──────────────────────────────── */
  .ss-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .ss-del {
    opacity: 1;
  }

  /* ── Calendar ─────────────────────────────────── */
  .cal-nav {
    gap: 8px;
  }

  .cal-month-lbl {
    min-width: 110px;
    font-size: 13px;
  }

  .cal-grid thead th {
    padding: 8px 2px 10px;
    font-size: 9px;
    letter-spacing: 0;
  }

  .cal-grid thead th.week-th {
    width: 48px;
    padding-right: 4px;
  }

  .cal-day {
    min-height: 52px;
    padding: 6px 4px;
  }

  .cal-day-num {
    font-size: 11px;
  }

  .cal-day-pnl {
    font-size: 9px;
    margin-top: 3px;
  }

  .cal-day-badge {
    display: none;
  }

  .cal-week-total {
    padding: 6px 4px;
    min-height: 52px;
  }

  .wt-lbl {
    display: none;
  }

  .wt-val {
    font-size: 10px;
  }

  .cal-month-total-row td {
    padding: 16px;
  }

  .cal-month-summary {
    gap: 16px;
    padding: 10px 4px;
    flex-wrap: wrap;
  }

  .cal-ms-val {
    font-size: 13px;
  }

  /* ── Playbooks ────────────────────────────────── */
  .pb-grid {
    grid-template-columns: 1fr;
  }

  .pb-card {
    padding: 18px;
  }

  /* ── Buttons ──────────────────────────────────── */
  .btn {
    padding: 8px 14px;
    font-size: 11px;
    line-height: 1;
  }

  .btn-sm {
    padding: 8px 14px;
    font-size: 11px;
  }
}

/* Extra small phones */
@media (max-width: 480px) {

  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-val {
    font-size: 16px;
  }

  .main {
    padding: 16px 12px 86px;
  }

  .page-title {
    font-size: 16px;
  }

  .cal-day {
    min-height: 48px;
    padding: 5px 3px;
  }

  .cal-day-pnl {
    font-size: 9px;
  }

  .modal {
    padding: 20px 16px;
  }
}

/* ══════════════════════════════════════════════════
   ANALYTICS & RISK
══════════════════════════════════════════════════ */

/* ── Risk Settings Grid ───────────────────────── */
.risk-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

/* ── Daily Loss Meter ─────────────────────────── */
.risk-meter-track {
  height: 12px;
  background: var(--surface3);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.risk-meter-fill {
  height: 100%;
  border-radius: 8px;
  transition: width .4s ease, background .4s ease;
  width: 0%;
}

.risk-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
}

/* ── Position Size Calculator Result ─────────── */
.calc-result {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.calc-result-row span {
  color: var(--text3);
  font-size: 12px;
}

.calc-result-row strong {
  color: var(--text-strong);
  font-weight: 600;
  font-size: 14px;
}

/* ── Mobile overrides ─────────────────────────── */
@media (max-width: 768px) {
  .risk-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .risk-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════
   AUTH — Login / Register
══════════════════════════════════════════════════ */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.auth-overlay.show {
  display: flex;
}

.auth-overlay::before,
.auth-overlay::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-overlay::before {
  width: 900px; height: 900px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(124, 106, 247, 0.18) 0%,
    rgba(124, 106, 247, 0.06) 40%,
    transparent 70%);
}

.auth-overlay::after {
  width: 500px; height: 500px;
  top: 50%; left: 50%;
  transform: translate(-40%, -60%);
  background: radial-gradient(ellipse at center,
    rgba(99, 179, 237, 0.08) 0%,
    transparent 65%);
}

.auth-box {
  width: 380px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  position: relative; z-index: 1;
  padding: 40px 36px;
  animation: mup .25s ease;
}

.auth-logo {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-strong);
  display: block;
  text-align: center;
  text-align: center;
  letter-spacing: -0.5px;
}

.auth-logo em {
  font-style: normal;
  color: var(--accent);
}

.auth-tag {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 32px;
  margin-top: 2px;
  letter-spacing: .5px;
}

.auth-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 20px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-error {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  margin-top: 8px;
}

.auth-switch-link {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  margin-left: 4px;
}

.auth-switch-link:hover {
  text-decoration: underline;
}

/* ── Logout button ──────────────────────────────── */
.btn-logout {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  line-height: 1;
}

.btn-logout:hover {
  color: var(--red);
  background: var(--red-bg);
}

/* ── Sidebar user label ─────────────────────────── */
.sidebar-footer {
  justify-content: flex-start;
}

/* ── Sign Out button ──────────────────────────────── */
.btn-signout {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text3);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}

.btn-signout .lucide {
  width: 13px;
  height: 13px;
}

.btn-signout:hover {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

/* ── API Key display ──────────────────────────────── */
.apikey-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 768px) {
  .apikey-row {
    flex-direction: column;
    align-items: stretch;
  }

  .apikey-row .btn {
    width: 100%;
  }
}

.apikey-display {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .5px;
  word-break: break-all;
  user-select: all;
}

/* ── MT5 EA Download Cards ────────────────────────── */
.ea-download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ea-download-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ea-download-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text1);
}

.ea-download-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
  flex: 1;
}

.ea-download-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .ea-download-grid { grid-template-columns: 1fr; }
}

/* ── MT5 Sync Page ────────────────────────────────── */
.mt5-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mt5-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.mt5-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt5-step-body {
  flex: 1;
  padding-top: 4px;
}

.mt5-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.mt5-step-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
  margin-bottom: 10px;
}

.mt5-code {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .3px;
}

/* ── Pagination ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text2);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all .15s;
}

.pg-btn:hover:not(:disabled) {
  background: var(--surface3);
  color: var(--text-strong);
  border-color: var(--border2);
}

.pg-btn.pg-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pg-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── 2-column grid for calculator ────────────────── */
.calc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .calc-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── Risk of Ruin ─────────────────────────────────── */
.ror-result {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
  margin-bottom: 4px;
}

.ror-gauge {
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.ror-pct {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.ror-lbl {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .ror-result {
    flex-direction: column;
  }

  .ror-gauge {
    flex-direction: row;
    gap: 12px;
    padding: 14px 16px;
    min-width: unset;
  }

  .ror-pct {
    margin-bottom: 0;
  }
}

/* ── Nav separator ────────────────────────────────── */
.nav-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}


.panel-body .stat-row {
  margin-bottom: 0;
}

/* ── Profile Page ─────────────────────────────────── */
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-meta {
  flex: 1;
}

.profile-username {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.profile-joined {
  font-size: 12px;
  color: var(--text3);
}

/* ── Weekly Report ────────────────────────────────── */
.rpt-compare-item {
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rpt-compare-lbl {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}

.rpt-compare-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ── Forgot password modal — above auth overlay ───── */
#forgotOverlay {
  z-index: 10000;
}

/* ── Modal body — no extra padding, uses modal's own padding ── */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Playbook Stats ───────────────────────────────── */
.pb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pb-stat {
  text-align: center;
}

.pb-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 2px;
}

.pb-stat-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.pb-no-trades {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

/* ── Playbook Rules Preview (in trade form) ───────── */
.pb-rules-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text2);
  white-space: pre-line;
  line-height: 1.7;
}

/* ── Custom Confirm Modal ─────────────────────────── */
#confirmOverlay {
  z-index: 10001;
}

/* ══════════════════════════════════════════════════
   STREAK ALERT BANNER
══════════════════════════════════════════════════ */
.streak-alert {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  animation: mup .3s ease;
}

.streak-alert-icon {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}

.streak-alert-body {
  flex: 1;
}

.streak-alert-title {
  font-size: 14px;
  font-weight: 700;
  color: #ef4444;
  margin-bottom: 4px;
}

.streak-alert-msg {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
}

.streak-alert-close {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.streak-alert-close:hover {
  color: var(--red);
}

/* ══════════════════════════════════════════════════
   PERFORMANCE HEATMAP
══════════════════════════════════════════════════ */
.heatmap-wrap {
  overflow-x: auto;
  padding-bottom: 4px;
}

.heatmap-container {
  display: flex;
  gap: 4px;
  min-width: 640px;
}

.heatmap-days {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 20px;
  /* align with month labels */
}

.hm-day-lbl {
  height: 13px;
  font-size: 9px;
  color: var(--text3);
  display: flex;
  align-items: center;
  width: 12px;
}

.heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.heatmap-months {
  display: flex;
  height: 16px;
}

.hm-month-lbl {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
}

.heatmap-weeks {
  display: flex;
  gap: 3px;
}

.hm-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hm-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: var(--surface3);
  cursor: default;
  transition: opacity .1s;
}

.hm-cell:hover {
  opacity: 0.75;
}

.hm-empty {
  background: transparent;
  cursor: default;
}

.hm-zero {
  background: var(--surface3);
}

/* Legend dots */
.hm-legend-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text3);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .hm-legend-group {
    width: 100%;
    margin-top: 4px;
  }
}

.hm-legend {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.hm-legend.pos {
  background: #22c55e;
}

.hm-legend.neg {
  background: #ef4444;
}

@media (max-width: 768px) {
  .hm-cell {
    width: 11px;
    height: 11px;
  }
}

/* ══════════════════════════════════════════════════
   TRADE TAGS / LABELS
══════════════════════════════════════════════════ */
.trade-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.trade-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(124, 106, 247, 0.15);
  border: 1px solid rgba(124, 106, 247, 0.35);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.tag-del {
  background: none;
  border: none;
  color: var(--accent);
  opacity: 0.6;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  line-height: 1;
  margin-left: 2px;
}

.tag-del:hover {
  opacity: 1;
}

.trade-tag-sm {
  display: inline-block;
  background: rgba(124, 106, 247, 0.12);
  border: 1px solid rgba(124, 106, 247, 0.25);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
}

.tag-info {
  font-size: 12px;
  color: var(--text3);
  padding: 8px 10px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 5-column stat row ────────────────────────────── */
.stat-row-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 768px) {
  .stat-row-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ══════════════════════════════════════════════════
   AI ANALYSIS PAGE
══════════════════════════════════════════════════ */
.ai-key-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-key-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .ai-key-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-key-btns {
    width: 100%;
  }

  .ai-key-btns .btn {
    flex: 1;
  }
}

.ai-key-status {
  margin-top: 10px;
  font-size: 13px;
}

.ai-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ai-type-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  text-align: left;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Poppins', sans-serif;
}

.ai-type-btn:hover {
  border-color: var(--accent);
  background: var(--surface3);
}

.ai-type-btn.active {
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.1);
}

.ai-type-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--accent);
  display: inline-flex;
}

.ai-type-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}

.ai-type-desc {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.5;
}

/* Loading dots */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 0;
}

.ai-loading-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 4px;
  animation: ai-bounce .8s ease-in-out infinite;
}

.ai-loading {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
}

.ai-loading div:last-child {
  flex-basis: 100%;
  text-align: center;
  margin-top: 16px;
}

.ai-loading-dot:nth-child(2) {
  animation-delay: .15s;
}

.ai-loading-dot:nth-child(3) {
  animation-delay: .30s;
}

@keyframes ai-bounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: .4;
  }

  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Result formatting */
.ai-result {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.75;
}

.ai-result h4.ai-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-strong);
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.ai-result h4.ai-section-title:first-child {
  margin-top: 0;
}

.ai-result h5.ai-sub-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin: 14px 0 6px;
}

.ai-result .ai-point {
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--accent);
  margin: 8px 0;
  color: var(--text);
}

.ai-result .ai-bullet {
  padding: 3px 0 3px 8px;
  color: var(--text2);
}

.ai-result p {
  margin: 8px 0;
}

.ai-result strong {
  color: var(--text-strong);
}

@media (max-width: 768px) {
  .ai-type-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .ai-type-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════
   TRADE REPLAY
══════════════════════════════════════════════════ */
.replay-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.replay-filters .pp-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 150px;
}

.replay-filters .pp-select-btn {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .replay-filters {
    width: 100%;
  }
  .replay-filters .pp-select,
  .replay-filters .fc,
  .replay-filters input[type="date"] {
    flex: 1 1 auto;
    min-width: 0;
  }
}
.replay-progress {
  height: 4px;
  background: var(--surface3);
  border-radius: 2px;
  margin-bottom: 12px;
  overflow: hidden;
}

.replay-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s ease;
}

.replay-counter {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 500;
}

.replay-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
}

.replay-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.replay-symbol {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.replay-meta {
  font-size: 12px;
  color: var(--text3);
}

.replay-pnl {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.replay-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.replay-stat {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.replay-stat-lbl {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.replay-stat-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.replay-screenshot {
  margin-bottom: 16px;
}

.ss-img-wrap {
  position: relative;
  width: 100%;
  min-height: 180px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
}

.ss-img-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.ss-img-loader::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid #333;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ssImgSpin .7s linear infinite;
}

@keyframes ssImgSpin { to { transform: rotate(360deg); } }

.replay-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: opacity .2s;
  display: block;
}

.replay-img:hover {
  opacity: 0.9;
}

.replay-no-ss {
  text-align: center;
  padding: 32px;
  color: var(--text3);
  font-size: 13px;
  background: var(--surface2);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.replay-ai {
  margin-top: 16px;
  padding: 16px;
  background: rgba(124, 106, 247, 0.07);
  border: 1px solid rgba(124, 106, 247, 0.2);
  border-radius: var(--radius);
}

.replay-ai-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
}

.replay-ai-body {
  margin-top: 8px;
}

.replay-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 16px;
}

.replay-nav-mid {
  font-size: 12px;
  color: var(--text3);
  padding: 0 12px;
}

kbd {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
  font-family: 'Poppins', sans-serif;
  color: var(--text2);
}

@media (max-width: 768px) {
  .replay-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .replay-card {
    padding: 18px;
    width: 100%;
    box-sizing: border-box;
  }

  .replay-card-hd {
    flex-direction: column;
    gap: 8px;
  }

  .replay-pnl {
    font-size: 22px;
  }

  .replay-nav-mid {
    display: none;
  }

  .replay-ai {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ══════════════════════════════════════════════════
   DAILY JOURNAL
══════════════════════════════════════════════════ */
.jta {
  min-height: 110px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.65;
}

.mood-picker {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 8px 0;
}

.mood-btn {
  font-size: 28px;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all .15s;
  opacity: 0.5;
  line-height: 1;
}

.mood-btn:hover {
  opacity: 1;
  background: var(--surface2);
}

.mood-btn.active {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(124, 106, 247, 0.1);
}

/* ══════════════════════════════════════════════════
   ACCOUNT SWITCHER
══════════════════════════════════════════════════ */
.acc-switcher {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.acc-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-strong);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 28px 7px 10px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: var(--select-arrow);
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.acc-select:focus {
  border-color: var(--accent);
  background-color: var(--surface3);
}

.mobile-acc-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Account switcher shows inside the slide-in sidebar */
  .acc-switcher {
    display: block;
  }

  /* Mobile acc bar no longer needed — switcher is in sidebar */
  .mobile-acc-bar {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════
   REPLAY SCREENSHOT NAVIGATOR
══════════════════════════════════════════════════ */
.ss-nav-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ss-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ss-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1;
  padding: 4px 14px;
  cursor: pointer;
  transition: background .15s;
}

.ss-nav-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.ss-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.ss-nav-counter {
  font-size: 12px;
  color: var(--text2);
  min-width: 40px;
  text-align: center;
}

.ss-nav-dots {
  display: flex;
  gap: 6px;
}

.ss-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background .15s;
}

.ss-dot.active {
  background: var(--accent);
}

.ss-dot:hover {
  background: var(--text2);
}

/* ══════════════════════════════════════════════════
   TRADE DETAIL SCREENSHOT NAVIGATOR
══════════════════════════════════════════════════ */
.ss-main-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #000;
  cursor: zoom-in;
  display: block;
}

.ss-thumb-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}

.ss-thumb-mini {
  position: relative;
  width: 72px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s;
  flex-shrink: 0;
}

.ss-thumb-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ss-thumb-mini.active {
  border-color: var(--accent);
}

.ss-thumb-mini:hover {
  border-color: var(--text2);
}

.ss-thumb-mini .ss-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .7);
  border: none;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}

.ss-thumb-mini:hover .ss-del {
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   LIGHTBOX NAV
══════════════════════════════════════════════════ */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: background .15s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.lb-nav:hover:not(:disabled) {
  background: var(--accent);
}

.lb-nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.lb-prev {
  left: 16px;
}

.lb-next {
  right: 16px;
}

.lb-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'Poppins', sans-serif;
}

/* ══════════════════════════════════════════════════
   PROFILE STAT ROW — full width 4-col grid
══════════════════════════════════════════════════ */
.stat-row-4-full {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stat-row-4-full .stat-card {
  width: 100%;
}

@media (max-width: 600px) {
  .stat-row-4-full {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════
   LIGHTBOX ANNOTATION
══════════════════════════════════════════════════ */
#lbCanvas {
  position: fixed;
  border-radius: 4px;
  display: none;
  touch-action: none;
  z-index: 1001;
  cursor: crosshair;
}

#lbCanvas.active {
  display: block;
}

/* Annotate button */
.lb-annotate-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-family: 'Poppins', sans-serif;
  padding: 7px 14px;
  cursor: pointer;
  transition: background .15s;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lb-annotate-btn svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  flex-shrink: 0;
}

.lb-annotate-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Annotation toolbar */
.ann-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, .95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 20;
  flex-wrap: wrap;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.ann-tools,
.ann-colors,
.ann-sizes {
  display: flex;
  gap: 4px;
  align-items: center;
}

.ann-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

.ann-tool {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.ann-tool:hover {
  background: var(--surface2);
}

.ann-tool.active {
  border-color: var(--accent);
  background: rgba(124, 106, 247, .15);
}

.ann-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s;
}

.ann-color:hover {
  transform: scale(1.2);
}

.ann-color.active {
  border-color: #fff;
  transform: scale(1.2);
}

.ann-size {
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all .15s;
  font-family: 'Poppins', sans-serif;
}

.ann-size:hover {
  background: var(--surface2);
}

.ann-size.active {
  border-color: var(--accent);
  background: rgba(124, 106, 247, .15);
}

.ann-action {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .15s;
  font-family: 'Poppins', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ann-action:hover {
  background: var(--surface2);
}

.ann-save {
  background: var(--accent) !important;
  border-radius: 8px;
  font-size: 12px;
  padding: 5px 12px;
  font-weight: 600;
}

.ann-save:hover {
  opacity: .85;
}

.ann-cancel {
  font-size: 14px;
  color: var(--text2);
}

/* Text input overlay */
#annTextInput {
  position: absolute;
  background: transparent;
  border: 1px dashed var(--accent);
  color: #fff;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  padding: 2px 6px;
  outline: none;
  min-width: 80px;
  z-index: 30;
  display: none;
}

@media (max-width: 600px) {
  .ann-toolbar {
    left: 8px;
    right: 8px;
    transform: none;
    width: auto;
    top: 8px;
    padding: 8px 12px;
  }
  .ann-tool {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .ann-sep {
    display: none;
  }
}

/* ── Theme Toggle ─────────────────────────────────── */
.btn-theme {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text3);
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-theme:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
