[hidden] {
  display: none !important;
}

/* Minimalist Replay Splash / Loading Screen */
.replay-splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1329;
  z-index: 9999;
}

.replay-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.splash-logo {
  animation: pulseLogo 2s infinite ease-in-out;
}

@keyframes pulseLogo {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

.splash-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.splash-text {
  color: #94a3b8;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 0;
}

.access-gate {
  max-width: 680px;
  margin: 10vh auto;
  padding: 40px;
  border: 1px solid #334155;
  background: #111d32;
  border-radius: 20px;
}

.access-gate h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.access-gate p {
  line-height: 1.7;
  color: #cbd5e1;
}

.access-gate-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.access-gate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.access-gate-actions a.btn-signup,
.access-gate a.btn-signup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
  margin: 0;
}

.access-gate-actions a.btn-signup:hover {
  background: #1d4ed8;
}

.access-gate a {
  display: inline-block;
  margin: 10px 12px 0 0;
  padding: 12px 18px;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  text-decoration: none;
}

header {
  flex-wrap: wrap;
  gap: 12px;
}

header nav {
  flex-wrap: wrap;
  gap: 6px;
}

.header-right {
  flex-wrap: wrap;
}

#modalContent table {
  width: 100%;
}

/* Practice Run Row with Right-Aligned P&L and Delete Button */
.practice-run-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  width: 100%;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#modalContent .practice-run-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 8px;
  color: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  margin: 0;
}

#modalContent .practice-run-btn:hover {
  background: rgba(51, 65, 85, 0.85);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.practice-run-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.run-sym {
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.run-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

.run-status-active {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.run-status-completed {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.run-days {
  font-size: 12px;
  color: #64748b;
}

.practice-run-right {
  display: flex;
  align-items: center;
}

.run-pnl {
  font-size: 14px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.run-pnl.pnl-pos {
  color: #10b981;
}

.run-pnl.pnl-neg {
  color: #ef4444;
}

.run-pnl.pnl-zero {
  color: #94a3b8;
}

.practice-run-delete-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.practice-run-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
}

.practice-run-delete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.empty-runs-notice {
  color: #64748b;
  font-style: italic;
  padding: 12px 0;
}

.more-runs-btn {
  margin-top: 10px;
  width: 100%;
}

/* Replay Auth Modal & Scoped Styles */
.access-gate button.btn-primary {
  display: inline-block;
  margin: 10px 12px 0 0;
  padding: 12px 18px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.access-gate button.btn-primary:hover {
  background: #1d4ed8;
}

.replay-auth-modal {
  border: 1px solid #334155;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 16px;
  padding: 0;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.replay-auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.replay-auth-modal .auth-modal-panel {
  padding: 28px;
}

.replay-auth-modal .auth-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.replay-auth-modal .auth-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 4px 0;
}

.replay-auth-modal .auth-modal-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
}

.replay-auth-modal .auth-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: -4px -4px 0 0;
}

.replay-auth-modal .auth-modal-close:hover {
  color: #ffffff;
}

.replay-auth-modal .auth-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.replay-auth-modal .btn-retry-verify {
  background: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.replay-auth-modal .btn-retry-verify:hover {
  background: #dc2626;
}

.replay-auth-modal .auth-notice-box {
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid #3b82f6;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.replay-auth-modal .auth-notice-box .notice-title {
  font-size: 1rem;
  font-weight: 600;
  color: #93c5fd;
  margin: 0 0 6px 0;
}

.replay-auth-modal .auth-notice-box .notice-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1;
  margin: 0 0 14px 0;
}

.replay-auth-modal .btn-continue-signup {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 10px 14px;
  background: #2563eb;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.replay-auth-modal .btn-continue-signup:hover {
  background: #1d4ed8;
}

.replay-auth-modal .btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.replay-auth-modal .btn-google:hover:not(:disabled) {
  background: #334155;
  border-color: #475569;
}

.replay-auth-modal .btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.replay-auth-modal .auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.replay-auth-modal .auth-divider::before,
.replay-auth-modal .auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #334155;
}

.replay-auth-modal .auth-divider span {
  padding: 0 10px;
}

.replay-auth-modal .form-field {
  margin-bottom: 14px;
}

.replay-auth-modal .form-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.replay-auth-modal .form-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.replay-auth-modal .form-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.replay-auth-modal .btn-submit-auth {
  width: 100%;
  padding: 12px 16px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 6px;
}

.replay-auth-modal .btn-submit-auth:hover:not(:disabled) {
  background: #1d4ed8;
}

.replay-auth-modal .btn-submit-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.replay-auth-modal .auth-modal-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
}

.replay-auth-modal .auth-link {
  color: #60a5fa;
  text-decoration: underline;
  margin-left: 6px;
}

.replay-auth-modal .auth-link:hover {
  color: #93c5fd;
}

/* Centered Chart Canvas Loading Overlay */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 500;
  pointer-events: auto;
  z-index: 50;
}

.chart-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===============================================================
   Header User Pill & Dropdown Menu (Ported from pricing.html)
   =============================================================== */
#logged-in-state {
  position: relative;
  display: inline-block;
}

#user-menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: #f8fafc;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#user-menu-button:hover {
  background: #1e293b;
}

#user-menu-button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

#user-menu-button .user-menu-details {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-grow: 1;
  overflow: hidden;
}

@media (max-width: 767px) {
  #user-menu-button .user-menu-details {
    display: none !important;
  }
}

#user-profile-pic.hidden,
#user-initial-avatar.hidden,
#user-menu-dropdown.hidden {
  display: none !important;
}

#logged-in-state .w-full {
  width: 100% !important;
}

#logged-in-state .h-full {
  height: 100% !important;
}

.relative {
  position: relative;
}

.w-8 {
  width: 32px;
}

.h-8 {
  height: 32px;
}

.rounded-full {
  border-radius: 9999px;
}

.bg-slate-700 {
  background-color: #334155;
}

.object-cover {
  object-fit: cover;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-menu-button .w-8.h-8,
#user-menu-button .user-avatar-wrap {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 9999px !important;
  overflow: hidden !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  background-color: #334155 !important;
}

#user-profile-pic {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  border-radius: 9999px !important;
  object-fit: cover !important;
  display: block !important;
}

#user-initial-avatar {
  font-size: 0.875rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#user-name-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.25rem;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1;
  white-space: nowrap;
}

#user-plan-badge.bg-amber-500\/20,
#user-plan-badge.plan-trial {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

#user-plan-badge.bg-blue-500\/20,
#user-plan-badge.plan-pro {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

#user-plan-badge.bg-purple-500\/20,
#user-plan-badge.plan-basic {
  background-color: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

#user-plan-badge.bg-slate-500\/20,
#user-plan-badge.plan-free {
  background-color: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

#user-menu-button ion-icon[name="chevron-down-outline"] {
  color: #94a3b8;
  font-size: 0.875rem;
  flex-shrink: 0;
}

#user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 224px;
  background-color: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  padding: 4px 0;
  z-index: 1000;
}

#user-menu-dropdown.hidden {
  display: none !important;
}

#user-menu-dropdown .border-b {
  border-bottom: 1px solid #334155;
}

#user-menu-dropdown .border-t {
  border-top: 1px solid #334155;
  margin: 4px 0;
}

#user-menu-dropdown .px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

#user-menu-dropdown .py-3 {
  padding-top: 10px;
  padding-bottom: 10px;
}

#user-menu-dropdown .py-2 {
  padding-top: 8px;
  padding-bottom: 8px;
}

#dropdown-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.25rem;
}

#dropdown-user-email {
  font-size: 0.75rem;
  color: #94a3b8;
  margin: 2px 0 0 0;
  line-height: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#user-menu-dropdown a,
#user-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  font-size: 0.85rem;
  color: #cbd5e1;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: inherit;
}

#user-menu-dropdown a:hover,
#user-menu-dropdown button:hover {
  background-color: #1e293b;
  color: #ffffff;
}

#user-menu-dropdown button#signout-btn {
  color: #f87171;
}

#user-menu-dropdown button#signout-btn:hover {
  background-color: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

#user-menu-dropdown ion-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===============================================================
   Contract Calibration & Admin Instrument Modal Enhancements
   =============================================================== */
.locked-currency-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #38bdf8;
  user-select: none;
}

.locked-currency-badge .currency-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

.locked-currency-badge .currency-code {
  font-weight: 600;
  color: #f1f5f9;
}

.locked-currency-badge .locked-tag {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  margin-left: auto;
}

.admin-inst-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
}

.admin-inst-table th,
.admin-inst-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #334155;
  font-size: 0.85rem;
}

.admin-inst-table th {
  color: #94a3b8;
  font-weight: 600;
  background: #1e293b;
}

.admin-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.admin-delete-btn:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ===============================================================
   PRACTICE HISTORY MODAL REVAMP
   =============================================================== */
.practice-kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}

.practice-kpi-grid .stat {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 58px;
}

/* 4-column top row (cards 1-4 span 3) */
.practice-kpi-grid .stat:nth-child(1),
.practice-kpi-grid .stat:nth-child(2),
.practice-kpi-grid .stat:nth-child(3),
.practice-kpi-grid .stat:nth-child(4) {
  grid-column: span 3;
}

/* 3-column bottom row (cards 5-7 span 4) */
.practice-kpi-grid .stat:nth-child(5),
.practice-kpi-grid .stat:nth-child(6),
.practice-kpi-grid .stat:nth-child(7) {
  grid-column: span 4;
}

.practice-kpi-grid .stat b {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
}

.practice-kpi-grid .stat.stat-dual b {
  font-size: 12.5px;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.practice-kpi-grid .stat small {
  display: block;
  font-size: 9px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.practice-table-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 8px;
}

.practice-table-top h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #cbd5e1;
  margin: 0;
}

.modal-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-icon-btn,
.icon-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #38bdf8;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.modal-icon-btn:hover,
.icon-download-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.modal-icon-btn svg,
.icon-download-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* ===============================================================
   ADMIN MANAGE INSTRUMENTS COMPACT GRID
   =============================================================== */
#modalBackdrop .modal:has(.admin-compact-form),
.backdrop .modal:has(.admin-compact-form),
#modalBackdrop .modal.modal-admin,
.backdrop .modal.modal-admin,
.modal.modal-admin,
dialog#modal.modal-admin,
dialog#modal[data-modal-kind="admin"],
dialog#modal:has(.admin-compact-form) {
  max-width: 860px !important;
  width: 92vw !important;
}

.admin-compact-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.admin-grid-row {
  display: grid;
  gap: 10px;
  width: 100%;
}

.admin-row-4,
.admin-compact-form .admin-row-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px;
}

.admin-row-3,
.admin-compact-form .admin-row-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px;
}

.admin-grid-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.admin-grid-row input,
.admin-grid-row select {
  background: #0f172a;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}

.admin-grid-row input:focus,
.admin-grid-row select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.admin-grid-row input[type="file"] {
  padding: 4px;
  font-size: 0.75rem;
}

.admin-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.admin-flags-row .check {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: #cbd5e1;
}

@media (max-width: 768px) {
  .practice-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .practice-kpi-grid .stat:nth-child(n) {
    grid-column: span 1;
  }

  .practice-kpi-grid .stat:nth-child(7) {
    grid-column: span 2;
  }
}

@media (max-width: 480px) {

  .admin-compact-form .admin-row-4,
  .admin-compact-form .admin-row-3,
  .admin-row-4,
  .admin-row-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ===============================================================
   Mobile Layout (< 768px) - Header, Dropdown, Modals & Popovers
   =============================================================== */
@media (max-width: 767.98px) {

  /* Prevent horizontal page overflow on mobile */
  html,
  body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  main.layout,
  .layout {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Header & Navigation Bar */
  header {
    position: relative !important;
    z-index: 1000 !important;
    min-height: 52px !important;
    height: auto !important;
    padding: 6px 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  header .brand {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }

  header .brand b {
    font-size: 11px !important;
  }

  .header-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: auto !important;
    flex-wrap: nowrap !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }

  .header-right #dataBtn {
    display: none !important;
  }

  .header-right #settingsBtn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #cbd5e1 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: color 0.15s ease, background-color 0.15s ease !important;
  }

  .header-right #settingsBtn:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
  }

  #logged-in-state {
    position: relative !important;
    flex-shrink: 0 !important;
  }

  #user-menu-button {
    padding: 2px 4px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  #user-menu-button .user-menu-details {
    display: none !important;
  }

  #user-menu-button ion-icon[name="chevron-down-outline"] {
    display: inline-block !important;
    font-size: 0.875rem !important;
    color: #94a3b8 !important;
    flex-shrink: 0 !important;
    margin-left: 2px !important;
  }

  #user-menu-dropdown {
    position: absolute !important;
    right: 0 !important;
    top: calc(100% + 6px) !important;
    width: 220px !important;
    max-width: calc(100vw - 24px) !important;
    z-index: 10001 !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 4px 8px rgba(0, 0, 0, 0.4) !important;
  }

  /* Chart Toolbar & Mobile Iconization */
  .chart-toolbar {
    flex-shrink: 0 !important;
    height: auto !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    overflow: visible !important;
  }

  .chart-toolbar .instrument {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  .chart-toolbar .tools {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  .chart-toolbar .tools button {
    padding: 4px 6px !important;
    min-width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .chart-toolbar .tools select {
    height: 28px !important;
    font-size: 11px !important;
    padding: 2px 4px !important;
    box-sizing: border-box !important;
    background-color: #1c222e !important;
    border: 1px solid var(--line, #282d37) !important;
    border-radius: 6px !important;
    color: #dce2eb !important;
    flex-shrink: 0 !important;
  }

  #layoutToggle {
    font-size: 0 !important;
  }

  #layoutToggle::before {
    content: "▦" !important;
    font-size: 13px !important;
  }

  #emaToggle {
    font-size: 0 !important;
    padding: 4px 6px !important;
  }

  #emaToggle::before {
    content: "EMA" !important;
    font-size: 10px !important;
    font-weight: 600 !important;
  }

  #emaSettings {
    font-size: 0 !important;
  }

  #emaSettings::before {
    content: "⚙" !important;
    font-size: 13px !important;
  }

  #drawToggle {
    font-size: 0 !important;
  }

  #drawToggle::before {
    content: "╱" !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  #levelsToggle {
    font-size: 0 !important;
  }

  #levelsToggle::before {
    content: "≡" !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  #calibrateBtn {
    font-size: 0 !important;
  }

  #calibrateBtn::before {
    content: "⚖" !important;
    font-size: 13px !important;
  }

  #fit {
    font-size: 0 !important;
  }

  #fit::before {
    content: "⤢" !important;
    font-size: 13px !important;
  }

  #addSL {
    font-size: 10px !important;
    padding: 4px 6px !important;
    min-width: 28px !important;
  }

  #addTP {
    font-size: 10px !important;
    padding: 4px 6px !important;
    min-width: 28px !important;
  }

  .chart-toolbar .tools #theme {
    width: auto !important;
    max-width: 58px !important;
    height: 28px !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    background-color: #1c222e !important;
    border: 1px solid var(--line, #282d37) !important;
    border-radius: 6px !important;
    color: #dce2eb !important;
    flex-shrink: 0 !important;
  }

  /* Replay Controls (Below Chart) Mobile Iconization */
  .replaybar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px 4px !important;
    padding: 6px 8px !important;
    min-height: auto !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  .mini-trade {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .replay-left {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-left: auto !important;
  }

  .session-navigation {
    order: 3 !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    min-width: 170px !important;
  }

  .mini-trade button,
  .session-navigation button,
  .replay-left button {
    height: 28px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #miniBuy {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 30px !important;
  }

  #miniBuy::before {
    content: "B" !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  #miniSell {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 30px !important;
  }

  #miniSell::before {
    content: "S" !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  #miniExit {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 30px !important;
  }

  #miniExit::before {
    content: "⏏" !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  #nextChart {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 28px !important;
  }

  #nextChart::before {
    content: "⤨" !important;
    font-size: 13px !important;
    font-weight: 700 !important;
  }

  #sessionDate {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 28px !important;
  }

  #sessionDate::before {
    content: "▦" !important;
    font-size: 12px !important;
  }

  #step {
    font-size: 0 !important;
    padding: 4px 8px !important;
    min-width: 28px !important;
  }

  #step kbd {
    display: none !important;
  }

  #step::before {
    content: "⏭" !important;
    font-size: 13px !important;
  }

  #play {
    padding: 4px 8px !important;
    min-width: 28px !important;
    height: 28px !important;
  }

  #sessionOrder,
  #speed {
    height: 28px !important;
    padding: 2px 4px !important;
    font-size: 10px !important;
    width: auto !important;
  }

  .progress {
    order: 4 !important;
    margin-left: auto !important;
    font-size: 9px !important;
    min-width: 60px !important;
  }

  .chart-card {
    height: clamp(440px, 70vh, 620px) !important;
    min-height: 440px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .chart-card .canvas-wrap {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .chart-card .chart-toolbar,
  .chart-card .chart-meta,
  .chart-card .replaybar {
    flex-shrink: 0 !important;
  }

  body.chart-full .chart-card {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  body.chart-full .chart-card .chart-toolbar {
    flex-shrink: 0 !important;
  }

  body.chart-full .chart-card .chart-meta {
    flex-shrink: 0 !important;
  }

  body.chart-full .chart-card .canvas-wrap {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100% !important;
  }

  body.chart-full .chart-card .replaybar {
    flex-shrink: 0 !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
  }

  body.chart-full #layoutMenu,
  body.chart-full #drawingMenu,
  body.chart-full #quickMenu {
    z-index: 100005 !important;
  }

  /* Replay Settings Modal Mobile Containment */
  dialog#modal,
  dialog {
    width: calc(100vw - 24px) !important;
    max-width: 100% !important;
    margin: auto !important;
    padding: 16px !important;
    max-height: 85vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  dialog#modal .modal-top,
  dialog .modal-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 14px !important;
    width: 100% !important;
  }

  dialog#modal .modal-top h2,
  dialog .modal-top h2 {
    font-size: 18px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  dialog#modal .modal-top-right,
  dialog .modal-top-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  dialog#modal #modalContent,
  dialog #modalContent {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  dialog#modal .settings-grid,
  dialog .settings-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  dialog#modal .settings-grid label,
  dialog .settings-grid label {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 11px !important;
  }

  dialog#modal input,
  dialog#modal select,
  dialog#modal textarea,
  dialog input,
  dialog select,
  dialog textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  dialog#modal .modal-actions,
  dialog .modal-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  dialog#modal .modal-actions button.primary,
  dialog .modal-actions button.primary,
  dialog#modal .modal-actions #saveSettings {
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  /* Chart Layout Popover Menu (Fixed relative to viewport) */
  #layoutMenu.chart-popup,
  #layoutMenu {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    z-index: 10000 !important;
    max-height: calc(100vh - 80px) !important;
    overflow-y: auto !important;
  }

  #layoutMenu .layout-options,
  .layout-options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #layoutMenu .layout-options button,
  .layout-options button {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px 4px !important;
  }
}

/* Replay mobile controls and browser-local practice scopes. */
#sessionDate[hidden],
#sessionCalendar[hidden],
#replayApp [hidden] {
  display: none !important;
}

#sessionCalendar,
#quickMenu,
#layoutMenu,
#drawingMenu {
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 16px);
  overflow: auto;
  overscroll-behavior: contain;
}

body.chart-full #sessionCalendar,
body.chart-full #quickMenu,
body.chart-full #layoutMenu,
body.chart-full #drawingMenu {
  z-index: 100010 !important;
}

#replayMenuButton,
#replayChartMenuButton,
#settingsBtn {
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #cbd5e1 !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 6px !important;
  font-size: 18px !important;
  line-height: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

#replayMenuButton,
#replayChartMenuButton {
  display: none;
}

#replayMenuButton {
  font-size: 20px !important;
}

#replayMenuButton:hover,
#replayChartMenuButton:hover,
#settingsBtn:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
}

dialog#replayMenuDialog {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  right: 12px !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  width: 230px !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  padding: 4px 0 !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4) !important;
  overflow: auto !important;
  z-index: 10001 !important;
}

dialog#replayMenuDialog::backdrop {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(2px);
}

#replayMenuDialog .quick-heading {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 16px !important;
  margin: 0 !important;
  border-bottom: 1px solid #334155 !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
}

#replayMenuDialog .quick-heading button#closeReplayMenu {
  padding: 4px 6px !important;
  border: none !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 18px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
}

#replayMenuDialog .quick-heading button#closeReplayMenu:hover {
  color: #ffffff !important;
  background-color: #1e293b !important;
}

#replayMenuDialog>button {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
  padding: 9px 16px !important;
  margin: 0 !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  font-family: inherit !important;
  color: #cbd5e1 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

#replayMenuDialog>button:hover {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

#replayMenuDialog>button:focus-visible {
  outline: none !important;
  background-color: #1e293b !important;
  color: #ffffff !important;
}

#replayMenuDialog>button:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  background: transparent !important;
}

#replayMenuDialog>button.active {
  color: #60a5fa !important;
  font-weight: 600 !important;
}

#replayMenuDialog>button[data-replay-action="dataBtn"] {
  border-top: 1px solid #1e293b !important;
}

.currency-stats+.currency-stats {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line, #384457);
}

.currency-stats h3 {
  margin: 8px 0;
}

.practice-scope-note {
  padding: 12px;
  border: 1px solid #5289ca66;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  background: #5289ca12;
}

#activeDayHistory {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line, #384457);
}

#activeDayHistory summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.chart-pane canvas {
  touch-action: none;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

@media (max-width: 780px) {
  #replayMenuButton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 20px !important;
  }

  #replayNav {
    display: none !important;
  }

  body.chart-full #replayChartMenuButton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 18px !important;
  }

  .replaybar>.session-navigation {
    flex-wrap: nowrap !important;
  }

  body.chart-full .chart-card .replaybar {
    max-height: 42dvh;
    overflow-y: auto;
    padding-left: max(8px, env(safe-area-inset-left)) !important;
    padding-right: max(8px, env(safe-area-inset-right)) !important;
  }

  body.chart-full .chart-card .chart-toolbar {
    max-height: 35dvh;
    overflow-y: auto;
    padding-top: max(6px, env(safe-area-inset-top));
  }

  body.chart-full .chart-card .chart-meta {
    min-height: 0;
  }
}

body:not(.chart-full) #replayChartMenuButton {
  display: none !important;
}

@media (pointer: coarse) and (min-width: 781px) and (max-width: 1100px) {
  #replayNav {
    display: none !important;
  }

  #replayMenuButton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    font-size: 20px !important;
  }

  body.chart-full #replayChartMenuButton {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }

  body.chart-full .chart-card {
    min-height: 0 !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 99999 !important;
  }

  body.chart-full .canvas-wrap {
    flex: 1 1 0%;
    min-height: 0;
  }

  body.chart-full .chart-toolbar,
  body.chart-full .replaybar {
    flex-shrink: 0;
  }

  body.chart-full .replaybar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* The chart grid's normal minimum must not push controls below a short viewport. */
body.chart-full .chart-card {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  box-sizing: border-box !important;
  z-index: 99999 !important;
}

body.chart-full #chartGrid {
  min-height: 0 !important;
  flex: 1 1 0% !important;
  height: auto !important;
}

body.chart-full .chart-card .chart-toolbar,
body.chart-full .chart-card .chart-meta,
body.chart-full .chart-card .replaybar {
  flex-shrink: 0 !important;
}

body.chart-full .chart-card {
  background: #0f172a !important;
}

/* One currency at a time in combined practice statistics. */
.stats-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stats-controls .filters {
  margin: 0;
}

.stats-currency-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line, #384457);
  border-radius: 8px;
}

.stats-currency-toggle button {
  padding: 7px 10px;
  min-height: 34px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.stats-currency-toggle button.active {
  background: #3b82f633;
  color: #93c5fd;
  box-shadow: inset 0 0 0 1px #60a5fa77;
}

.stats-currency-toggle button:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

.stats-controls .filters {
  gap: 4px;
}

.stats-controls .filters button {
  padding: 7px 8px;
  min-height: 34px;
  font-size: 12px;
}

#dataBtn .btn-icon {
  display: inline-block;
}

#dataBtn .btn-text {
  display: inline;
}

/* ===============================================================
   EMA / Moving Averages Color Picker Rounded Square Box
   =============================================================== */
dialog#modal input[type="color"],
dialog input[type="color"],
.settings-grid input[type="color"],
input[type="color"] {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  box-sizing: border-box !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  padding: 3px !important;
  border: 1px solid #334155 !important;
  border-radius: 8px !important;
  background-color: #1e293b !important;
  cursor: pointer !important;
  display: block !important;
  margin-top: 4px !important;
  transition: border-color 0.15s ease, transform 0.15s ease !important;
}

dialog#modal input[type="color"]:hover,
dialog input[type="color"]:hover,
.settings-grid input[type="color"]:hover,
input[type="color"]:hover {
  border-color: #3b82f6 !important;
  transform: scale(1.04);
}

dialog#modal input[type="color"]:focus-visible,
dialog input[type="color"]:focus-visible,
.settings-grid input[type="color"]:focus-visible,
input[type="color"]:focus-visible {
  outline: 2px solid #3b82f6 !important;
  outline-offset: 2px !important;
}

dialog#modal input[type="color"]::-webkit-color-swatch-wrapper,
dialog input[type="color"]::-webkit-color-swatch-wrapper,
.settings-grid input[type="color"]::-webkit-color-swatch-wrapper,
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0 !important;
  border-radius: 6px !important;
}

dialog#modal input[type="color"]::-webkit-color-swatch,
dialog input[type="color"]::-webkit-color-swatch,
.settings-grid input[type="color"]::-webkit-color-swatch,
input[type="color"]::-webkit-color-swatch {
  border: none !important;
  border-radius: 5px !important;
}

dialog#modal input[type="color"]::-moz-color-swatch,
dialog input[type="color"]::-moz-color-swatch,
.settings-grid input[type="color"]::-moz-color-swatch,
input[type="color"]::-moz-color-swatch {
  border: none !important;
  border-radius: 5px !important;
}

.settings-grid label.color-picker-label,
.settings-grid label:has(input[type="color"]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  align-items: flex-start !important;
}


/* Floating Drawing Toolbar */
.drawing-toolbar {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  user-select: none;
}

.drawing-toolbar[hidden] {
  display: none !important;
}

.drawing-toolbar .drawing-color-picker {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid #64748b !important;
  border-radius: 4px !important;
  cursor: pointer;
  background: transparent !important;
}

.drawing-toolbar .drawing-color-picker::-webkit-color-swatch-wrapper {
  padding: 0 !important;
}

.drawing-toolbar .drawing-color-picker::-webkit-color-swatch {
  border: none !important;
  border-radius: 3px !important;
}

.drawing-toolbar .drawing-copy-btn,
.drawing-toolbar .drawing-delete {
  font-size: 11px !important;
  font-weight: 500 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  cursor: pointer;
  border: 1px solid #475569 !important;
  background: #334155 !important;
  color: #f1f5f9 !important;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.4 !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.drawing-toolbar .drawing-copy-btn[hidden] {
  display: none !important;
}

.drawing-toolbar .drawing-copy-btn:hover {
  background: #475569 !important;
  border-color: #94a3b8 !important;
  color: #ffffff !important;
}

.drawing-toolbar .drawing-delete {
  position: static !important;
  background: #1e293b !important;
  color: #fca5a5 !important;
  border-color: #64748b !important;
}

.drawing-toolbar .drawing-delete:hover {
  background: #7f1d1d !important;
  border-color: #ef4444 !important;
  color: #fecaca !important;
}