  :root {
    --bg:            #0d0f11;
    --bg-secondary:  #101214;
    --surface:       #16191c;
    --surface-2:     #1b1f23;
    --surface-hover: #20252a;
    --border:        #23272b;
    --border-light:  #2d3237;
    --text:          #e6e8ea;
    --text-muted:    #a9aeb4;
    --text-dim:      #7a8188;

    --green:         #3aa57a;
    --green-light:   #4cc08f;
    --green-bg:      rgba(58,165,122,0.12);
    --green-glow:    rgba(58,165,122,0.10);

    --red:           #db5a4a;
    --red-light:     #e8786a;
    --red-bg:        rgba(219,90,74,0.12);
    --red-glow:      rgba(219,90,74,0.10);

    --blue:          #2f8cff;
    --blue-bg:       rgba(47,140,255,0.12);

    --amber:         #e3b341;
    --amber-bg:      rgba(227,179,65,0.12);

    --accent:        #2f8cff;
    --accent-2:      #1d5fe0;
    --accent-ink:    #5aa2ff;
    --accent-glow:   rgba(47,140,255,0.14);

    --gold:          #e3b341;

    --radius:        8px;
    --radius-lg:     10px;
    --shadow-sm:     none;
    --shadow-md:     0 8px 24px rgba(5,7,9,0.45);
    --shadow-lg:     0 16px 40px rgba(5,7,9,0.55);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  /* (the old grid background is gone: plain, calm surface) */

  /* ── AUTH MODAL ─────────────────────────────────────────── */
  #authModal .modal {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(91,141,238,0.06);
  }

  /* ── HEADER ─────────────────────────────────────────────── */
  header {
    background: rgba(8,11,16,0.85);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    height: 60px;
  }

  .logo-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .logo {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1;
  }



  .logo-motto {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding-left: 16px;
    margin-top: 2px;
  }

  .header-stats {
    display: flex;
    gap: 0;
    align-items: center;
  }

  .header-stat {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0 1.5rem;
    border-right: 1px solid var(--border);
  }

  .header-stat:first-child { border-left: 1px solid var(--border); }

  .header-stat-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-weight: 500;
  }

  .header-stat-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
  }

  .header-stat-value.positive { color: var(--green-light); }
  .header-stat-value.negative { color: var(--red-light); }

  .header-actions { display: flex; gap: 0.6rem; align-items: center; }

  /* ── NAVIGATION ─────────────────────────────────────────── */
  .nav-tabs {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    gap: 0;
    position: sticky;
    top: 60px;
    z-index: 90;
    backdrop-filter: blur(12px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }

  .tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-btn:hover { color: var(--text); }

  .tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
  }

  /* ── MAIN ───────────────────────────────────────────────── */
  main {
    padding: 1.75rem 2rem;
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }

  .view { display: none; }
  .view.active { display: block; animation: fadeIn 0.2s ease; }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── BUTTONS ─────────────────────────────────────────────── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.55rem 1.1rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.18s;
    white-space: nowrap;
  }

  .btn:hover {
    background: transparent;
    color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 16px var(--accent-glow);
  }

  .btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
  }

  .btn-secondary:hover {
    color: var(--text);
    border-color: var(--text-muted);
    background: var(--surface-hover);
    box-shadow: none;
  }

  .btn-small { padding: 0.38rem 0.75rem; font-size: 0.7rem; }

  /* ── STAT CARDS ──────────────────────────────────────────── */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
  }

  .stat-card:hover {
    border-color: var(--border-light);
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: transparent;
    transition: background 0.2s;
  }

  .stat-card.profit::before { background: var(--green); }
  .stat-card.loss::before { background: var(--red); }
  .stat-card.info::before { background: var(--accent); }
  .stat-card.neutral::before { background: var(--amber); }

  .stat-card::after { display: none; }

  .stat-card-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 0.7rem;
  }

  .stat-card-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.45rem;
    letter-spacing: -0.01em;
  }

  .stat-card-sub {
    font-size: 0.68rem;
    color: var(--text-dim);
  }

  /* ── FILTER BAR ──────────────────────────────────────────── */
  .filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
  }

  .filter-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-weight: 600;
  }

  .filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    padding: 0.38rem 0.75rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
  }

  .filter-select:focus { border-color: var(--accent); color: var(--text); }

  /* ── TRADE LIST ──────────────────────────────────────────── */
  .trade-list { display: flex; flex-direction: column; gap: 0.5rem; }

  .trade-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 44px 1fr auto auto auto;
    gap: 1.25rem;
    align-items: center;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    overflow: hidden;
  }

  .trade-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
  }

  .trade-card.win::before { background: linear-gradient(180deg, var(--green-light), var(--green)); }
  .trade-card.loss::before { background: linear-gradient(180deg, var(--red-light), var(--red)); }
  .trade-card.breakeven::before { background: var(--text-dim); }

  .trade-card:hover {
    border-color: var(--border-light);
    background: var(--surface-2);
  }

  .trade-card.win:hover { border-color: rgba(34,176,106,0.4); }
  .trade-card.loss:hover { border-color: rgba(229,79,86,0.4); }

  .trade-status {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .trade-status.win {
    background: var(--green-bg);
    color: var(--green-light);
    border: 1px solid rgba(46,166,100,0.3);
  }

  .trade-status.loss {
    background: var(--red-bg);
    color: var(--red-light);
    border: 1px solid rgba(229,72,77,0.3);
  }

  .trade-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }

  .trade-symbol {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .trade-meta {
    font-size: 0.67rem;
    color: var(--text-dim);
    font-family: 'IBM Plex Mono', monospace;
  }

  .trade-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.72rem;
  }

  .trade-detail { display: flex; flex-direction: column; gap: 0.2rem; }

  .trade-detail-label {
    color: var(--text-dim);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
  }

  .trade-pnl {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: right;
    min-width: 90px;
  }

  .trade-pnl.positive { color: var(--green-light); }
  .trade-pnl.negative { color: var(--red-light); }

  .icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
    flex-shrink: 0;
  }

  .icon-btn:hover { border-color: var(--text-muted); color: var(--text); background: var(--surface-hover); }
  .icon-btn.delete:hover { border-color: var(--red) !important; color: var(--red) !important; background: var(--red-bg) !important; }

  /* ── MODAL ───────────────────────────────────────────────── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,7,11,0.82);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s;
  }

  .modal-overlay.open { opacity: 1; pointer-events: all; }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 700px;
    max-width: 96vw;
    max-height: 92vh;
    overflow-y: auto;
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.16,1,0.3,1);
    box-shadow: var(--shadow-lg);
  }

  .modal-overlay.open .modal { transform: translateY(0) scale(1); }

  .modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  .close-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .close-btn:hover { border-color: var(--text-muted); color: var(--text); }

  .modal-body { padding: 1.75rem; }

  .form-section { margin-bottom: 1.75rem; }

  .form-section-title {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .form-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
  }

  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-bottom: 0.9rem; }

  .form-group { display: flex; flex-direction: column; gap: 0.45rem; }

  .form-group label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-weight: 600;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    padding: 0.6rem 0.85rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
  }

  .form-group textarea { resize: vertical; min-height: 80px; }

  .radio-group { display: flex; gap: 0.6rem; flex-wrap: wrap; }

  .radio-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.15s;
  }

  .radio-option:hover { border-color: var(--border-light); color: var(--text); }

  .radio-option input[type="radio"],
  .radio-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: var(--accent);
  }

  .modal-actions {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  /* ── CHART CARD ──────────────────────────────────────────── */
  .chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
  }

  .chart-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
  }

  /* ── PATTERNS ────────────────────────────────────────────── */
  .pattern-list { display: flex; flex-direction: column; gap: 0.5rem; }

  .pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    transition: border-color 0.15s;
  }

  .pattern-item:hover { border-color: var(--border-light); }
  .pattern-name { color: var(--text); font-weight: 500; }
  .pattern-stat { color: var(--text-muted); font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; }

  /* ── BAR CHART ───────────────────────────────────────────── */
  .bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding: 0.5rem 0 1.5rem;
  }

  .bar {
    flex: 1;
    min-height: 4px;
    border-radius: 3px 3px 0 0;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    opacity: 0.85;
  }

  .bar:hover { opacity: 1; transform: scaleY(1.03); transform-origin: bottom; }
  .bar.positive { background: linear-gradient(180deg, var(--green-light), var(--green)); }
  .bar.negative { background: linear-gradient(180deg, var(--red-light), var(--red)); }

  .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.58rem;
    color: var(--text-dim);
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
  }

  /* ── EMPTY STATE ─────────────────────────────────────────── */
  .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
    font-size: 0.85rem;
  }

  .empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; display: block; }

  /* ── SECTION HEADER ──────────────────────────────────────── */
  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
  }

  /* ── IMAGE UPLOAD ────────────────────────────────────────── */
  .image-upload {
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
    font-size: 0.82rem;
    color: var(--text-dim);
  }

  .image-upload:hover { border-color: var(--accent); background: var(--surface); color: var(--text-muted); }
  .image-upload input { display: none; }
  .image-preview { max-width: 100%; height: auto; margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius); }

  /* ── ANALYTICS GRIDS ─────────────────────────────────────── */
  .analytics-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }

  /* ── CALENDAR ────────────────────────────────────────────── */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
  }

  .calendar-day-label {
    text-align: center;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0.4rem 0;
    font-weight: 600;
  }

  .calendar-day {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    min-height: 68px;
    transition: border-color 0.15s;
  }

  .calendar-day:hover { border-color: var(--border-light); }
  .calendar-day.today { outline: 1.5px solid var(--accent); outline-offset: 1px; }
  .calendar-day.profitable { background: rgba(14,32,22,0.8); border-color: rgba(46,166,100,0.25); }
  .calendar-day.losing { background: rgba(26,8,9,0.8); border-color: rgba(229,72,77,0.25); }

  /* ── NOTEBOOK ────────────────────────────────────────────── */
  .notebook-entry-item {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
  }

  .notebook-entry-item:hover { background: var(--surface-hover); }
  .notebook-entry-item.active { background: var(--surface-2); border-left: 2px solid var(--accent); }

  /* ── SCROLLBAR ───────────────────────────────────────────── */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 10px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

  @media (max-width: 900px) {
    .header-stats { display: none; }
    .analytics-grid { grid-template-columns: 1fr; }
    .trade-card { grid-template-columns: 36px 1fr auto; }
    .trade-details, .trade-pnl { grid-column: 1 / -1; }
    main { padding: 1rem; }
  }

  /* ══════════════════════════════════════════════════════════
     EDGECRAFTER — FUTURISTIC DESIGN LAYER
  ══════════════════════════════════════════════════════════ */

  /* ── KEYFRAMES ─────────────────────────────────────────── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
  }
  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107,155,239,0); }
    50%       { box-shadow: 0 0 20px 4px rgba(107,155,239,0.15); }
  }
  @keyframes shimmerLine {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
  }
  @keyframes countUp {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes borderPulse {
    0%, 100% { border-color: var(--border); }
    50%       { border-color: var(--border-light); }
  }
  @keyframes dotBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
  }
  @keyframes scanLine {
    0%   { top: -2px; }
    100% { top: 100%; }
  }
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
  }
  @keyframes glowPulse {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1; }
  }
  @keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }

  /* ── GLOBAL ENHANCEMENTS ────────────────────────────────── */
  /* Global transition removed — was causing constant repaints on all elements.
     Transitions are now only on specific interactive elements (buttons, cards, inputs). */

  /* Override for elements that shouldn't transition layout props */
  canvas, svg, img { transition: none !important; }

  /* Animated gradient background blob */
  body::after {
    content: '';
    position: fixed;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107,155,239,0.03) 0%, transparent 70%);
    top: -200px; right: -200px;
    pointer-events: none;
    z-index: 0;
    animation: glowPulse 8s ease-in-out infinite;
  }

  /* ── VIEW ANIMATIONS ────────────────────────────────────── */
  .view { display: none; }
  .view.active {
    display: block;
    animation: fadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ── HEADER ENHANCEMENT ─────────────────────────────────── */
  header {
    background: rgba(10,13,18,0.92) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  /* Logo animation */
  .logo {
    transition: none !important;
  }
  .logo img {
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  }
  .logo:hover img {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 0 20px rgba(107,155,239,0.3) !important;
  }

  /* Header stats number animation */
  .header-stat-value {
    animation: countUp 0.5s ease forwards;
    font-variant-numeric: tabular-nums;
  }

  /* ── NAVIGATION ENHANCEMENT ──────────────────────────────── */
  .nav-tabs {
    background: rgba(10,13,18,0.8) !important;
    backdrop-filter: blur(12px) !important;
  }

  .tab-btn {
    position: relative;
    overflow: hidden;
  }

  .tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: var(--accent);
    transition: left 0.25s ease, right 0.25s ease;
    border-radius: 2px 2px 0 0;
  }

  .tab-btn.active::after {
    left: 0; right: 0;
  }

  .tab-btn:hover:not(.active) {
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
  }

  /* ── STAT CARDS ENHANCEMENT ─────────────────────────────── */
  .stat-card {
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.4s ease forwards;
    backdrop-filter: blur(4px);
  }

  .stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: none;
  }

  .stat-card:hover::after {
    animation: shimmerLine 0.6s ease forwards;
  }

  .stat-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 1px 0 rgba(255,255,255,0.05) inset;
  }

  .stat-card.profit:hover { border-color: rgba(34,176,106,0.4); }
  .stat-card.loss:hover   { border-color: rgba(229,79,86,0.35); }
  .stat-card.info:hover   { border-color: rgba(107,155,239,0.4); }

  .stat-card-value {
    animation: countUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    letter-spacing: -0.02em;
  }

  /* Animated top border on cards */
  .stat-card::before {
    transition: opacity 0.2s ease, height 0.2s ease !important;
    height: 2px;
    opacity: 0.7;
  }
  .stat-card:hover::before { opacity: 1; height: 2px; }

  /* ── TRADE CARDS ENHANCEMENT ────────────────────────────── */
  .trade-card {
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.35s ease forwards;
    border-radius: var(--radius-lg) !important;
  }

  .trade-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: inherit;
  }

  .trade-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }

  .trade-card.win:hover   { border-color: rgba(34,176,106,0.35); box-shadow: 0 6px 20px rgba(34,176,106,0.08); }
  .trade-card.loss:hover  { border-color: rgba(229,79,86,0.3); box-shadow: 0 6px 20px rgba(229,79,86,0.06); }

  /* ── CHART CARDS ─────────────────────────────────────────── */
  .chart-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) !important;
    animation: fadeUp 0.4s ease forwards;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
  }

  .chart-card:hover {
    border-color: var(--border-light);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  }

  /* Futuristic scan line on chart cards */
  .chart-card::before {
    content: '';
    position: absolute;
    left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(107,155,239,0.3), transparent);
    top: -1px;
    animation: scanLine 6s linear infinite;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .chart-card:hover::before { opacity: 1; }

  /* ── BUTTONS ─────────────────────────────────────────────── */
  .btn {
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    font-weight: 600;
  }

  .btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
  }

  .btn:active::after {
    width: 200px; height: 200px;
    opacity: 0;
  }

  .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(107,155,239,0.25);
  }

  .btn:active:not(:disabled) { transform: translateY(0); }

  .btn-secondary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: var(--surface-hover);
  }

  /* ── FORM INPUTS ─────────────────────────────────────────── */
  input:not([type="radio"]):not([type="checkbox"]):not([type="file"]),
  select,
  textarea {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
  }

  input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):focus,
  select:focus,
  textarea:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(107,155,239,0.12), 0 1px 3px rgba(0,0,0,0.2) !important;
    background: rgba(107,155,239,0.04) !important;
    outline: none !important;
  }

  /* Radio options */
  .radio-option {
    transition: all 0.15s ease !important;
    border-radius: var(--radius) !important;
  }
  .radio-option:hover { background: rgba(107,155,239,0.08) !important; }

  /* ── MODAL ENHANCEMENTS ──────────────────────────────────── */
  .modal-overlay {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  .modal {
    animation: fadeUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset !important;
  }

  /* ── SECTION TITLES ──────────────────────────────────────── */
  .section-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  .section-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 1em;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    flex-shrink: 0;
  }

  /* ── LIVE INDICATOR ──────────────────────────────────────── */
  .live-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: dotBlink 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--green);
  }

  /* ── STAT GRID STAGGERED ANIMATION ──────────────────────── */
  .stat-grid > *:nth-child(1) { animation-delay: 0.05s; }
  .stat-grid > *:nth-child(2) { animation-delay: 0.10s; }
  .stat-grid > *:nth-child(3) { animation-delay: 0.15s; }
  .stat-grid > *:nth-child(4) { animation-delay: 0.20s; }
  .stat-grid > *:nth-child(5) { animation-delay: 0.25s; }
  .stat-grid > *:nth-child(6) { animation-delay: 0.30s; }
  .stat-grid > *:nth-child(7) { animation-delay: 0.35s; }

  /* ── TRADE JOURNAL LIST STAGGER ──────────────────────────── */
  .trade-card:nth-child(1)  { animation-delay: 0.03s; }
  .trade-card:nth-child(2)  { animation-delay: 0.06s; }
  .trade-card:nth-child(3)  { animation-delay: 0.09s; }
  .trade-card:nth-child(4)  { animation-delay: 0.12s; }
  .trade-card:nth-child(5)  { animation-delay: 0.15s; }
  .trade-card:nth-child(6)  { animation-delay: 0.18s; }

  /* ── COMPONENT FILTER CHIPS ──────────────────────────────── */
  #componentFilterChips button {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
  #componentFilterChips button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  /* ── SCROLLBAR ───────────────────────────────────────────── */
  ::-webkit-scrollbar { width: 4px; height: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

  /* ── GLASSMORPHISM CARDS IN ANALYTICS ───────────────────── */
  #analyticsView .chart-card,
  #patternsView .chart-card {
    background: rgba(19,24,34,0.7) !important;
    backdrop-filter: blur(8px);
  }

  /* ── PROFIT/LOSS COLOR PULSE ─────────────────────────────── */
  [style*="var(--green-light)"] { text-shadow: 0 0 20px rgba(61,208,132,0.2); }
  [style*="var(--red-light)"]   { text-shadow: 0 0 20px rgba(239,106,111,0.15); }

  /* ── TOOLTIP STYLE ───────────────────────────────────────── */
  [title] { cursor: help; }

  /* ── BADGE ANIMATIONS ────────────────────────────────────── */
  .trade-symbol span {
    transition: all 0.15s ease !important;
  }
  .trade-symbol span:hover {
    transform: scale(1.05) translateY(-1px);
  }

  /* ── NUMBER COUNTING EFFECT ──────────────────────────────── */
  @keyframes numberPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); color: var(--accent); }
    100% { transform: scale(1); }
  }

  /* ── FUTURISTIC CORNER ACCENTS ON LICENSE GATE ───────────── */
  #licenseGate .modal {
    position: relative;
  }
  #licenseGate .modal::before,
  #licenseGate .modal::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border-color: var(--accent);
    border-style: solid;
    border-width: 0;
    opacity: 0.6;
    transition: opacity 0.3s;
  }
  #licenseGate .modal::before {
    top: 12px; left: 12px;
    border-top-width: 1.5px;
    border-left-width: 1.5px;
    border-radius: 2px 0 0 0;
  }
  #licenseGate .modal::after {
    bottom: 12px; right: 12px;
    border-bottom-width: 1.5px;
    border-right-width: 1.5px;
    border-radius: 0 0 2px 0;
  }

  /* ── PERFORMANCE SCORE RING ──────────────────────────────── */
  circle[stroke-dasharray] {
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  /* ── EQUITY CURVE GLOW ───────────────────────────────────── */
  .chart-card canvas {
    border-radius: var(--radius);
  }

  /* ── CALENDAR CELLS ──────────────────────────────────────── */
  [class*="cal-day"] {
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  }
  [class*="cal-day"]:hover {
    transform: scale(1.04);
    z-index: 1;
    position: relative;
  }

  /* ── SECTION HEADER LINES ────────────────────────────────── */
  .chart-title {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: var(--text-muted) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .chart-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
  }

  /* ── DROPDOWN OPTIONS ───────────────────────────────────── */
  select option {
    background: #131822;
    color: #e8eef7;
  }
  select option:checked,
  select option:hover {
    background: #1a212e;
    color: #ffffff;
  }


  .filter-select {
    cursor: pointer;
  }
  .filter-select:hover {
    border-color: var(--border-light) !important;
    background: var(--surface-hover) !important;
  }

  /* ── MAIN CONTENT FADE ───────────────────────────────────── */
  main {
    animation: fadeIn 0.4s ease;
    position: relative;
    z-index: 1;
  }

  /* ── INSIGHT CARDS ───────────────────────────────────────── */
  [style*="border-left:3px"] {
    transition: border-color 0.2s ease, transform 0.15s ease !important;
  }
  [style*="border-left:3px"]:hover {
    transform: translateX(2px);
  }

  /* ── TRANSITIONS.DEV SKILL ──────────────────────────────────────────────── */
  /* Universal install block */
  :root {
    /* Modal open/close */
    --modal-duration:      0.28s;
    --modal-scale-hidden:  0.97;
    --modal-y-hidden:      14px;
    --modal-easing:        cubic-bezier(0.16, 1, 0.3, 1);
    --modal-overlay-color: rgba(0, 0, 0, 0.65);
    /* Error state shake */
    --err-duration:        0.5s;
    --err-x-amount:        6px;
    --err-easing:          cubic-bezier(0.36, 0.07, 0.19, 0.97);
    /* Icon swap (edit/delete icons) */
    --is-duration:         0.22s;
    --is-blur-amount:      4px;
    --is-scale-hidden:     0.72;
    --is-easing:           cubic-bezier(0.16, 1, 0.3, 1);
    /* Number pop-in (stat values) */
    --np-duration:         0.36s;
    --np-blur-start:       5px;
    --np-y-start:          -8px;
    --np-easing:           cubic-bezier(0.16, 1, 0.3, 1);
    /* Text states swap (tabs) */
    --ts-duration:         0.2s;
    --ts-blur-amount:      4px;
    --ts-y-offset:         5px;
    --ts-easing:           cubic-bezier(0.16, 1, 0.3, 1);
  }
  @media (prefers-reduced-motion: reduce) {
    :root {
      --modal-duration: 0s; --err-duration: 0s;
      --is-duration: 0s; --np-duration: 0s; --ts-duration: 0s;
    }
  }

  /* 1 ─ Modal open/close (replaces existing modal transform) */
  .modal-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--modal-duration) var(--modal-easing),
                background var(--modal-duration) ease;
    background: transparent !important;
  }
  .modal-overlay.open {
    opacity: 1;
    pointer-events: all;
    background: var(--modal-overlay-color) !important;
  }
  .modal {
    transform: translateY(var(--modal-y-hidden)) scale(var(--modal-scale-hidden));
    transition: transform var(--modal-duration) var(--modal-easing),
                opacity  var(--modal-duration) var(--modal-easing);
    opacity: 0;
  }
  .modal-overlay.open .modal {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  /* 2 ─ Error state shake */
  @keyframes t-error-shake {
    10%, 90%  { transform: translateX(calc(-1 * var(--err-x-amount) * 0.1)); }
    20%, 80%  { transform: translateX(calc(var(--err-x-amount) * 0.2)); }
    30%, 50%, 70% { transform: translateX(calc(-1 * var(--err-x-amount))); }
    40%, 60%  { transform: translateX(var(--err-x-amount)); }
    100%      { transform: translateX(0); }
  }
  .t-error-shake {
    animation: t-error-shake var(--err-duration) var(--err-easing) both;
  }

  /* 3 ─ Icon swap on action buttons (edit/delete) */
  @keyframes t-icon-swap-in {
    from { opacity: 0; filter: blur(var(--is-blur-amount)); transform: scale(var(--is-scale-hidden)); }
    to   { opacity: 1; filter: blur(0); transform: scale(1); }
  }
  .t-icon-btn {
    position: relative;
    overflow: hidden;
  }
  .t-icon-btn svg, .t-icon-btn .icon-inner {
    display: inline-block;
    transition: opacity var(--is-duration) var(--is-easing),
                transform var(--is-duration) var(--is-easing),
                filter var(--is-duration) var(--is-easing);
  }
  .t-icon-btn:hover svg, .t-icon-btn:hover .icon-inner {
    animation: t-icon-swap-in var(--is-duration) var(--is-easing) both;
  }

  /* 4 ─ Number pop-in for stat cards */
  @keyframes t-num-pop {
    from { opacity: 0; filter: blur(var(--np-blur-start)); transform: translateY(var(--np-y-start)); }
    to   { opacity: 1; filter: blur(0); transform: translateY(0); }
  }
  .t-num-pop {
    animation: t-num-pop var(--np-duration) var(--np-easing) both;
  }

  /* 5 ─ Text states swap on nav tabs */
  @keyframes t-tab-in {
    from { opacity: 0; filter: blur(var(--ts-blur-amount)); transform: translateY(var(--ts-y-offset)); }
    to   { opacity: 1; filter: blur(0); transform: translateY(0); }
  }
  .tab-btn.active .t-tab-label {
    animation: t-tab-in var(--ts-duration) var(--ts-easing) both;
  }
  .t-tab-label { display: inline-block; }

  /* 6 ─ Trade card hover (card resize feel) */
  .trade-card {
    transition:
      transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
      border-color 0.2s ease,
      box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .trade-card:hover {
    transform: translateY(-3px) scale(1.005) !important;
  }

  /* 7 ─ Stat card number pop on load */
  .stat-card {
    animation: t-num-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  /* ─────────────────────────────────────────────────────────────────────── */


  /* ── GSAP / ANIMATION ENHANCEMENTS ────────────────────────── */

  /* Stat cards */
  .stat-card { }

  /* Trade cards — sharper hover */
  .trade-card {
    transition: transform 0.2s cubic-bezier(0.16,1,0.3,1),
                border-color 0.18s ease,
                box-shadow 0.2s cubic-bezier(0.16,1,0.3,1) !important;
  }
  .trade-card:hover {
    transform: translateY(-3px) scale(1.004) !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.45) !important;
  }
  .trade-card.win:hover  { border-color: rgba(34,176,106,0.5) !important; }
  .trade-card.loss:hover { border-color: rgba(229,79,86,0.5)  !important; }

  /* View entrance animation */
  .view.active {
    animation: viewReveal 0.32s cubic-bezier(0.16,1,0.3,1) both !important;
  }
  @keyframes viewReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Chart cards — scan line shimmer on hover */
  .chart-card {
    position: relative;
    overflow: hidden;
  }
  .chart-card::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.025), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
  }
  .chart-card:hover::after {
    left: 150%;
  }

  /* Canvas containers — subtle inset border */
  canvas {
    border-radius: 4px;
  }

  /* Nav tab active indicator — animated underline grow */
  .tab-btn {
    position: relative;
  }
  .tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%; right: 50%;
    height: 2px;
    background: var(--accent);
    transition: left 0.2s cubic-bezier(0.16,1,0.3,1),
                right 0.2s cubic-bezier(0.16,1,0.3,1);
    border-radius: 1px 1px 0 0;
  }
  .tab-btn.active::after {
    left: 0; right: 0;
  }

  /* Header shimmer line */
  header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91,141,238,0.25), transparent);
    animation: headerSheen 6s ease-in-out infinite;
    pointer-events: none;
  }
  @keyframes headerSheen {
    0%   { opacity: 0.3; }
    50%  { opacity: 1; }
    100% { opacity: 0.3; }
  }

  /* Regime/insight cards pop in */
  @keyframes cardPop {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Stat value number pop on update */
  @keyframes numPop {
    0%   { transform: translateY(-6px); opacity: 0; filter: blur(4px); }
    100% { transform: translateY(0);    opacity: 1; filter: blur(0); }
  }
  .stat-value-updated {
    animation: numPop 0.3s cubic-bezier(0.16,1,0.3,1) both !important;
  }

  /* Drawdown bars — grow from left */
  .dd-bar {
    animation: growBar 0.5s cubic-bezier(0.16,1,0.3,1) both;
    transform-origin: left;
  }
  @keyframes growBar {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }

  /* Icon buttons — scale on hover */
  .icon-btn {
    transition: transform 0.15s cubic-bezier(0.16,1,0.3,1),
                border-color 0.15s ease,
                color 0.15s ease,
                background 0.15s ease !important;
  }
  .icon-btn:hover {
    transform: scale(1.1);
  }

  /* Modal spring entrance */
  .modal-overlay.open .modal {
    animation: modalSpring 0.3s cubic-bezier(0.16,1,0.3,1) both !important;
  }
  @keyframes modalSpring {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Scrollbar refinement */
  ::-webkit-scrollbar       { width: 4px; height: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

  /* ─────────────────────────────────────────────────────────── */

  /* ═══════════════════════════════════════════════════
     THEME SYSTEM
     (default) = Steel  — cold blue-grey, current look
     [data-theme="purple"] = Aurora — deep violet
     [data-theme="dark"]   = Obsidian — pure black
  ═══════════════════════════════════════════════════ */

  /* ── AURORA (Purple) ── */
  [data-theme="purple"] {
    --bg:            #07050f;
    --bg-secondary:  #0a0714;
    --surface:       #100d1f;
    --surface-2:     #16122c;
    --surface-hover: #1d1838;
    --border:        rgba(196,181,253,0.1);
    --border-light:  rgba(196,181,253,0.17);
    --text:          #e2dcf8;
    --text-muted:    #9b90c4;
    --text-dim:      #534880;

    --green:         #3dffa0;
    --green-light:   #56ffb2;
    --green-bg:      rgba(61,255,160,0.07);
    --green-glow:    rgba(61,255,160,0.18);

    --red:           #ff6b6b;
    --red-light:     #ff8f8f;
    --red-bg:        rgba(255,107,107,0.07);
    --red-glow:      rgba(255,107,107,0.18);

    --blue:          #818cf8;
    --blue-bg:       rgba(129,140,248,0.08);

    --amber:         #ffcc44;
    --amber-bg:      rgba(255,204,68,0.08);

    --accent:        #c4b5fd;
    --accent-2:      #a78bfa;
    --accent-glow:   rgba(196,181,253,0.2);

    --gold:          #ffcc44;

    --shadow-sm:     0 1px 2px rgba(0,0,0,0.4);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.55);
    --shadow-lg:     0 12px 32px rgba(0,0,0,0.65);
  }

  /* Purple ambient background */
  [data-theme="purple"] body {
    background-image:
      radial-gradient(ellipse 800px 500px at 10% 0%, rgba(139,92,246,0.06) 0%, transparent 70%),
      radial-gradient(ellipse 600px 400px at 90% 100%, rgba(196,181,253,0.04) 0%, transparent 70%);
  }

  /* Purple accent overrides */
  [data-theme="purple"] .tab-btn.active { border-bottom-color: var(--accent) !important; color: var(--accent) !important; }
  [data-theme="purple"] .btn { background: var(--accent) !important; color: #0a0714 !important; }
  [data-theme="purple"] .btn:hover { background: var(--accent-2) !important; }

  /* ── OBSIDIAN (Pure Dark) ── */
  [data-theme="dark"] {
    --bg:            #080808;
    --bg-secondary:  #0d0d0d;
    --surface:       #121212;
    --surface-2:     #181818;
    --surface-hover: #202020;
    --border:        rgba(255,255,255,0.07);
    --border-light:  rgba(255,255,255,0.12);
    --text:          #eeeeee;
    --text-muted:    #777777;
    --text-dim:      #444444;

    --green:         #22b06a;
    --green-light:   #3dd084;
    --green-bg:      rgba(34,176,106,0.06);
    --green-glow:    rgba(34,176,106,0.12);

    --red:           #e54f56;
    --red-light:     #ef6a6f;
    --red-bg:        rgba(229,79,86,0.06);
    --red-glow:      rgba(229,79,86,0.12);

    --blue:          #4d88d8;
    --blue-bg:       rgba(77,136,216,0.06);

    --amber:         #c8881e;
    --amber-bg:      rgba(200,136,30,0.07);

    --accent:        #5b8dee;
    --accent-2:      #7b6dd8;
    --accent-glow:   rgba(91,141,238,0.12);

    --gold:          #c8a84b;

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.5);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg:     0 16px 48px rgba(0,0,0,0.75);
  }

  [data-theme="dark"] body {
    background-image: none;
  }

  /* ── THEME SWITCHER UI ── */
  .theme-switcher {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 3px;
    flex-shrink: 0;
  }
  .theme-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1.5px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: transform 0.15s cubic-bezier(0.16,1,0.3,1),
                border-color 0.15s ease,
                box-shadow 0.15s ease;
    position: relative;
  }
  .theme-btn:hover { transform: scale(1.15); }
  .theme-btn.active {
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.06);
  }
  .theme-btn::after {
    content: '';
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: block;
    transition: box-shadow 0.15s;
  }
  .theme-btn.active::after {
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
  }
  /* Swatch colours */
  .theme-btn[data-t=""]::after {
    background: radial-gradient(circle at 35% 35%, #6b9bef, #1f2a3a);
  }
  .theme-btn[data-t="purple"]::after {
    background: radial-gradient(circle at 35% 35%, #c4b5fd, #4c1d95);
  }
  .theme-btn[data-t="dark"]::after {
    background: radial-gradient(circle at 35% 35%, #555, #0d0d0d);
    border: 1px solid rgba(255,255,255,0.15);
  }

  /* Theme transitions — only on the root so it doesn't cascade and repaint everything */
  :root { color-scheme: dark; }



/* ═══ Redesign · slice 1: shell, navigation, Overview ═══════════════ */
body { font-family: 'IBM Plex Sans', system-ui, sans-serif; }
.ec-top { position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 28px; padding: 0 28px;
  background: rgba(13,15,17,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.ec-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.ec-logo img { width: 26px; height: 26px; border-radius: 6px; }
.ec-logo span { font: 700 17px 'Saira', 'IBM Plex Sans', sans-serif; font-stretch: 125%; letter-spacing: .01em; }
.ec-groups { display: flex; gap: 4px; }
.ec-groups button { border: 0; background: none; color: var(--text-muted); font: 500 14px 'IBM Plex Sans', sans-serif; padding: 7px 13px; border-radius: 7px; cursor: pointer; transition: color .2s, background .2s; }
.ec-groups button:hover { color: var(--text); }
.ec-groups button.on { background: var(--surface); color: var(--text); }
.ec-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ec-seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.ec-seg button { border: 0; background: none; color: var(--text-muted); font: 500 13px 'IBM Plex Sans', sans-serif; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.ec-seg button.on { background: var(--accent-glow); color: var(--accent-ink); }
.ec-icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border-light); background: none; color: var(--text-muted); cursor: pointer; }
.ec-icon-btn:hover { color: var(--text); border-color: var(--text-dim); }
.ec-menu { position: relative; }
.ec-menu-pop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; padding: 6px; background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 10px; box-shadow: var(--shadow-lg); display: none; }
.ec-menu-pop.open { display: block; }
.ec-menu-pop button, .ec-menu-pop a { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--text); font: 14px 'IBM Plex Sans', sans-serif;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; text-decoration: none; }
.ec-menu-pop button:hover, .ec-menu-pop a:hover { background: var(--surface-hover); }
.ec-sub { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--border); background: var(--bg); }
.ec-sub:empty { display: none; }
.ec-sub button { border: 0; background: none; color: var(--text-muted); font: 500 13.5px 'IBM Plex Sans', sans-serif; padding: 12px 12px 11px; cursor: pointer; position: relative; }
.ec-sub button:hover { color: var(--text); }
.ec-sub button.on { color: var(--text); }
.ec-sub button.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.btn { background: var(--accent); }
.btn:hover { background: var(--accent-ink); }

/* Overview */
.ov { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.ov-hero { display: flex; align-items: flex-end; gap: 40px; padding: 6px 2px 22px; }
.ov-hero-num { flex: none; }
.ov-month { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.ov-month button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-light); background: none; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; }
.ov-month button:hover { color: var(--text); }
.ov-big { font: 600 46px/1 'IBM Plex Mono', monospace; letter-spacing: -0.04em; }
.ov-summary { color: var(--text-muted); max-width: 36em; font: italic 17px/1.55 'IBM Plex Serif', Georgia, serif; }
.ov-summary b { font: 600 15px 'IBM Plex Mono', monospace; font-style: normal; color: var(--text); }
.ov-summary b.pos, .ov-big.pos, .pos { color: var(--green); }
.ov-summary b.neg, .ov-big.neg, .neg { color: var(--red); }
.ov-cal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 128px; gap: 6px; }
.ov-cal .h { font: 600 11px 'IBM Plex Sans', sans-serif; color: var(--text-dim); padding-bottom: 2px; }
.ov-cal .d, .ov-cal .wk { height: 78px; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.ov-cal .d { background: var(--surface); border: 1px solid transparent; cursor: default; text-align: left; font: inherit; color: inherit; }
.ov-cal .d.has { cursor: pointer; }
.ov-cal .d.has:hover { border-color: var(--border-light); }
.ov-cal .d.w { background: linear-gradient(180deg, rgba(58,165,122,.18), rgba(58,165,122,.06)); }
.ov-cal .d.l { background: linear-gradient(180deg, rgba(219,90,74,.18), rgba(219,90,74,.06)); }
.ov-cal .d.sel { border-color: var(--accent); }
.ov-cal .d.out { opacity: .35; }
.ov-cal .n { font: 11px 'IBM Plex Mono', monospace; color: var(--text-dim); }
.ov-cal b { font: 600 15px 'IBM Plex Mono', monospace; }
.ov-cal small { font: 11px 'IBM Plex Sans', sans-serif; color: var(--text-dim); }
.ov-cal .wk { border: 1px dashed var(--border-light); }
.ov-day { margin-top: 22px; }
.ov-day-head { display: flex; justify-content: space-between; font: 600 13px 'IBM Plex Sans', sans-serif; color: var(--text-muted); margin-bottom: 8px; }
.ov-day-head span:last-child { font-family: 'IBM Plex Mono', monospace; }
.ov-row { display: grid; grid-template-columns: 64px 64px minmax(0, 1fr) 150px 64px 96px; gap: 12px; align-items: center; width: 100%;
  padding: 11px 14px; margin-bottom: 6px; background: var(--surface); border: 1px solid transparent; border-radius: 8px; cursor: pointer;
  font: 13px 'IBM Plex Sans', sans-serif; color: var(--text); text-align: left; transition: border-color .2s; }
.ov-row:hover { border-color: var(--border-light); }
.ov-row .mono { font-family: 'IBM Plex Mono', monospace; }
.ov-row .r { text-align: right; }
.ov-side-tag { font: 600 11px 'IBM Plex Mono', monospace; padding: 2px 6px; border-radius: 4px; justify-self: start; }
.ov-side-tag.l { color: var(--green); background: var(--green-bg); }
.ov-side-tag.s { color: var(--red); background: var(--red-bg); }
.ov-chip { display: inline-block; padding: 1px 7px; margin: 1px 2px 1px 0; border-radius: 4px; font: 500 11.5px 'IBM Plex Sans', sans-serif;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }
.ov-chip.warn { color: #f0a08f; background: var(--red-bg); border-color: transparent; }
.ov-empty { padding: 18px; border: 1px dashed var(--border-light); border-radius: 8px; color: var(--text-dim); font-size: 13px; }
.ov-side { display: grid; gap: 12px; }
.ov-card { background: var(--surface); border-radius: 10px; padding: 16px 18px; }
.ov-card .k { display: block; font: 600 11px 'IBM Plex Mono', monospace; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.ov-card p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.ov-card p b { color: var(--text); font-weight: 600; }
.ov-card p b.pos { color: var(--green); } .ov-card p b.neg { color: var(--red); }
.ov-card a { color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.ov-card a:hover { text-decoration: underline; }
.ov-bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.ov-bar i { display: block; height: 100%; border-radius: 3px; }
.ov-card.gex { border: 1px solid rgba(47,140,255,.35); background: linear-gradient(180deg, rgba(47,140,255,.08), transparent); }
@media (max-width: 1100px) { .ov { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .ec-top { gap: 12px; padding: 0 14px; } .ec-groups { display: none; } .ec-logo span { display: none; }
  .ec-sub { padding: 0 8px; overflow-x: auto; }
  .ov-hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ov-cal { grid-template-columns: repeat(5, minmax(0, 1fr)); } .ov-cal .wk, .ov-cal .h.wkh { display: none; }
  .ov-cal .d { height: 60px; padding: 6px; } .ov-cal b { font-size: 12px; } .ov-cal small { display: none; }
  .ov-row { grid-template-columns: 52px 56px minmax(0, 1fr) 80px; } .ov-row .hide-sm { display: none; }
}


/* ═══ Redesign · slice 2: Trades list ══════════════════════════════ */
.tl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tl-search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; max-width: 340px; padding: 0 12px; height: 36px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-dim); }
.tl-search:focus-within { border-color: var(--accent); }
.tl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 14px 'IBM Plex Sans', sans-serif; padding: 0; }
.tl-select { height: 36px; padding: 0 30px 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font: 13.5px 'IBM Plex Sans', sans-serif; max-width: 220px; }
.tl-summary { margin-left: auto; font-size: 13px; color: var(--text-muted); }
.tl-summary b { font-family: 'IBM Plex Mono', monospace; color: var(--text); font-weight: 600; }
.tl-summary b.pos { color: var(--green); } .tl-summary b.neg { color: var(--red); }
.trade-list.tl { display: block; background: var(--surface); border-radius: 10px; overflow-x: auto; }
.tl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tl-table th { text-align: left; font: 500 12px 'IBM Plex Sans', sans-serif; color: var(--text-dim); padding: 11px 12px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tl-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.tl-table .num { text-align: right; }
.tl-table .mono { font-family: 'IBM Plex Mono', monospace; }
.tl-table .pos { color: var(--green); } .tl-table .neg { color: var(--red); }
.tl-table .dim, .tl-summary .dim { color: var(--text-dim); }
.tl-row { cursor: pointer; transition: background .15s; }
.tl-row:hover { background: var(--surface-2); }
.tl-day td { background: var(--bg-secondary); padding: 8px 12px; font-size: 12.5px; color: var(--text-muted); }
.tl-day td { display: table-cell; }
.tl-day span:first-child { font-weight: 600; color: var(--text); margin-right: 10px; }
.tl-day b { float: right; font-weight: 600; }
.tl-setups { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.tl-strat { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tl-grade { font: 600 12.5px 'IBM Plex Mono', monospace; color: var(--accent-ink); }
.tl-stars { color: var(--gold); letter-spacing: 1px; font-size: 11.5px; } .tl-stars span { color: var(--border-light); }
.tl-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font: 600 10.5px 'IBM Plex Sans', sans-serif; vertical-align: 1px; }
.tl-badge.paper { color: var(--accent-ink); background: var(--accent-glow); }
.tl-badge.bad { color: #f0a08f; background: var(--red-bg); }
.tl-cam { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; color: var(--text-dim); font: 11px 'IBM Plex Mono', monospace; vertical-align: -2px; }
.tl-actions { text-align: right; width: 76px; }
.tl-actions button { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--text-dim);
  cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, border-color .15s; }
.tl-row:hover .tl-actions button, .tl-actions button:focus-visible { opacity: 1; }
.tl-actions button:hover { color: var(--text); border-color: var(--border-light); }
.tl-actions button[title="Delete trade"]:hover { color: var(--red); }
.tl-more { display: block; width: 100%; padding: 12px; border: 0; background: none; color: var(--accent-ink); font: 500 13.5px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.tl-more:hover { background: var(--surface-2); }
.tl-empty { padding: 40px 20px; text-align: center; color: var(--text-dim); }
.tl-empty b { color: var(--text); }
@media (hover: none) { .tl-actions button { opacity: 1; } }
@media (max-width: 900px) { .tl-strat, .tl-table th:nth-child(5), .tl-mistakes, .tl-table th:nth-last-child(2) { display: none; } .tl-summary { margin-left: 0; width: 100%; } }


/* ═══ Redesign · slice 3: Analyze ══════════════════════════════════ */
/* stat strip: one panel split by hairlines instead of seven glowing cards */
.stat-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important; gap: 0 !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 18px !important; }
/* hairlines on the right and bottom of every card; the panel's overflow clips the outer ones */
.stat-card { background: var(--surface) !important; border: 0 !important; border-radius: 0 !important; padding: 14px 16px !important;
  box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border) !important; transform: none !important; animation: none !important; }
.stat-card::before, .stat-card::after { display: none !important; }
.stat-card-label { font: 500 12px 'IBM Plex Sans', sans-serif !important; color: var(--text-muted) !important; text-transform: none !important; letter-spacing: 0 !important; }
.stat-card-value { font: 600 22px 'IBM Plex Mono', monospace !important; letter-spacing: -0.03em !important; margin-top: 4px !important; }
.stat-card-sub { font: 11.5px 'IBM Plex Mono', monospace !important; color: var(--text-dim) !important; text-transform: none !important; }

/* cards */
.chart-card { background: var(--surface) !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important; padding: 18px 20px !important; }
.chart-card::before, .chart-card::after { display: none !important; }
.chart-card:hover { transform: none !important; box-shadow: none !important; }
.chart-title { font: 600 13.5px 'IBM Plex Sans', sans-serif !important; color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; margin-bottom: 14px !important; }
#analyticsView > div[style*="grid"], #patternsView > div[style*="grid"] { gap: 16px !important; margin-bottom: 16px !important; }

/* Patterns rows */
.pattern-card, .patterns-grid > div { background: var(--surface) !important; border: 0 !important; border-radius: 10px !important; box-shadow: none !important; }
.pattern-item { background: var(--bg-secondary) !important; border: 0 !important; border-radius: 7px !important; }
.pattern-name { font: 500 13px 'IBM Plex Sans', sans-serif !important; display: flex; align-items: center; gap: 8px; }
.pattern-stat { font-family: 'IBM Plex Mono', monospace !important; }

/* drawn markers that replace emoji */
.ec-i { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.ec-i.ok { background: var(--green); } .ec-i.no { background: var(--red); } .ec-i.warn { background: var(--amber); } .ec-i.info { background: var(--accent); }

/* component lab chips */
#componentFilterChips button, #componentFilterChips span { border-radius: 6px !important; font-family: 'IBM Plex Sans', sans-serif !important; }

/* ═══ Screenshot reader in the Log trade form ═══════════════════════ */
.ec-reader { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border: 1px dashed var(--border); border-radius: 10px;
  background: var(--bg-secondary); cursor: pointer; transition: border-color .15s, background .15s; }
.ec-reader:hover, .ec-reader.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg-secondary)); }
.ec-reader.busy { cursor: progress; border-style: solid; border-color: var(--accent); }
.ec-reader.busy .ec-reader-icon { animation: ecPulse 1s ease-in-out infinite; }
@keyframes ecPulse { 50% { opacity: .35; } }
.ec-reader-icon { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ec-reader-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ec-reader-text b { font-weight: 600; color: var(--text); }
.ec-reader-text span { color: var(--text-muted); font-size: 12px; }
.ec-reader-result { margin-bottom: 18px; padding: 14px 16px; border-radius: 10px; background: var(--bg-secondary); font-size: 12.5px; }
.ec-reader-result .rr-head { display: flex; align-items: center; gap: 8px; color: var(--text); margin-bottom: 12px; }
.ec-reader-result .rr-head button { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: 4px 10px; font: 12px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.ec-reader-result .rr-head button:hover { color: var(--text); border-color: var(--text-muted); }
.rr-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.rr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.rr-cell { background: var(--surface); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.rr-cell span { color: var(--text-muted); font-size: 11px; }
.rr-cell b { font: 600 13px 'IBM Plex Mono', monospace; color: var(--text); }
.rr-cell.miss b { color: var(--text-dim); font: 400 12px 'IBM Plex Sans', sans-serif; }
.rr-note { margin-top: 10px; color: var(--text-muted); }
.rr-note.warn { color: var(--amber); }
/* fields the reader filled in, until the user touches them */
.ec-autofill { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent) !important; border-radius: 6px; }
.ec-reader[hidden], .ec-reader-result[hidden] { display: none; }


/* ═══ Redesign · slice 4: Prop firms ═══════════════════════════════ */
#fundedGrid { gap: 16px !important; }
.pf-card { background: var(--surface); border-radius: 10px; overflow: hidden; }
.pf-card.done { opacity: .72; }
.pf-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 14px; }
.pf-name { font: 600 16px 'IBM Plex Sans', sans-serif; display: flex; align-items: center; gap: 10px; }
.pf-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.pf-badge { font: 500 11px 'IBM Plex Sans', sans-serif; padding: 2px 8px; border-radius: 999px; }
.pf-badge.blue { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.pf-badge.green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pf-badge.red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pf-badge.dim { color: var(--text-muted); background: var(--bg-secondary); }
.pf-actions { display: flex; gap: 6px; }
.pf-actions button { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; padding: 5px 12px; font: 12.5px 'IBM Plex Sans', sans-serif; cursor: pointer; }
.pf-actions button:hover { color: var(--text); border-color: var(--text-muted); }
.pf-actions button.danger:hover { color: var(--red); border-color: var(--red); }
.pf-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border-top: 1px solid var(--border); }
.pf-metrics > div { padding: 14px 20px; display: flex; flex-direction: column; gap: 3px; box-shadow: -1px 0 0 var(--border); }
.pf-metrics span { font-size: 12px; color: var(--text-muted); }
.pf-metrics b { font: 600 19px 'IBM Plex Mono', monospace; letter-spacing: -0.02em; color: var(--text); }
.pf-metrics b.pos { color: var(--green); } .pf-metrics b.neg { color: var(--red); } .pf-metrics b.warn { color: var(--amber); }
.pf-metrics small { font: 11.5px 'IBM Plex Mono', monospace; color: var(--text-dim); }
.pf-dd { padding: 14px 20px; border-top: 1px solid var(--border); }
.pf-dd-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.pf-dd-row span:last-child { font-family: 'IBM Plex Mono', monospace; }
.pf-bar { height: 6px; border-radius: 3px; background: var(--bg-secondary); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.pf-dd.danger .pf-bar i { background: var(--red); }
.pf-warn { margin-top: 8px; font-size: 12.5px; color: var(--red); }
.pf-notes { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.pf-empty { background: var(--surface); border-radius: 10px; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.pf-empty b { font: 600 15px 'IBM Plex Sans', sans-serif; } .pf-empty span { color: var(--text-muted); font-size: 13px; max-width: 420px; margin-bottom: 8px; }

.pf-caveats { background: var(--surface); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; }
.pf-caveats summary { cursor: pointer; color: var(--amber); font-weight: 500; }
.pf-caveats ul { margin: 10px 0 2px; padding-left: 18px; color: var(--text-muted); display: grid; gap: 4px; }
#challengeView .form-group label, #montecarloView .form-group label { text-transform: none !important; letter-spacing: 0 !important; font: 500 12px 'IBM Plex Sans', sans-serif !important; color: var(--text-muted) !important; }
#challengeView .btn-secondary { background: var(--bg-secondary) !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; }
#challengeView .btn-secondary:hover { color: var(--text) !important; }


/* ═══ Redesign · slice 5: Playbook, Calendar, Notebook ═════════════ */
/* secondary buttons everywhere (a later .btn rule was painting them solid blue) */
.btn.btn-secondary { background: transparent !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; box-shadow: none !important; }
.btn.btn-secondary:hover { color: var(--text) !important; border-color: var(--text-muted) !important; }
.section-title { font: 600 18px 'IBM Plex Sans', sans-serif !important; letter-spacing: -0.01em; }
.section-title::before { display: none !important; }

/* strategies table */
.st-table { background: var(--surface); border-radius: 10px; overflow: hidden; }
.st-row { display: grid; grid-template-columns: minmax(220px, 2.2fr) 1.4fr .7fr 1fr 1.4fr .9fr .9fr; gap: 12px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); font: 13px 'IBM Plex Mono', monospace; }
.st-row > div:first-child { font-family: 'IBM Plex Sans', sans-serif; display: flex; flex-direction: column; gap: 3px; }
.st-row b { font-weight: 600; font-size: 14px; } .st-row small { color: var(--text-dim); font-size: 11.5px; font-family: 'IBM Plex Sans', sans-serif; }
.st-head { border-top: 0; font: 500 12px 'IBM Plex Sans', sans-serif; color: var(--text-muted); padding-top: 12px; padding-bottom: 10px; }
.st-row .pos { color: var(--green); } .st-row .neg { color: var(--red); }
.st-bar { display: block; height: 3px; border-radius: 2px; margin-top: 6px; background: var(--green); opacity: .6; } .st-bar.neg { background: var(--red); }
@media (max-width: 900px) { .st-row { grid-template-columns: 1fr 1fr; } .st-head { display: none; } }

/* playbooks */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.pb-card { background: var(--surface); border-radius: 10px; padding: 18px 20px; }
.pb-card header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pb-name { font: 600 15px 'IBM Plex Sans', sans-serif; }
.pb-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.pb-rules { margin: 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.pb-rules li { counter-increment: r; background: var(--bg-secondary); padding: 9px 12px; font-size: 13px; color: var(--text); display: flex; gap: 10px; }
.pb-rules li::before { content: counter(r); font: 12px 'IBM Plex Mono', monospace; color: var(--text-dim); min-width: 14px; }

/* daily checklist */
#morningChecklist label { padding: 12px 14px !important; border: 0 !important; border-radius: 8px !important; }
#checklistProgress { border: 0 !important; }

/* calendar */
#calendarView > div:first-child { justify-content: flex-start !important; gap: 12px; }
#calendarView > div:first-child .btn { padding: 6px 12px !important; }
#calendarTitle { font: 600 18px 'IBM Plex Sans', sans-serif !important; min-width: 170px; text-align: center; order: 0; }
.cal-summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.cal-summary > div { padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: -1px 0 0 var(--border); }
.cal-summary span { font-size: 12px; color: var(--text-muted); } .cal-summary b { font: 600 18px 'IBM Plex Mono', monospace; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr) 110px; gap: 4px; }
.cal-head { font-size: 12px; color: var(--text-muted); padding: 4px 8px; }
.cal-cell { min-height: 84px; background: var(--surface); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.cal-cell.blank { background: transparent; }
.cal-cell.up { background: color-mix(in srgb, var(--green) calc(var(--tint, .1) * 100%), var(--surface)); }
.cal-cell.down { background: color-mix(in srgb, var(--red) calc(var(--tint, .1) * 100%), var(--surface)); }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day { font-size: 12px; color: var(--text-muted); margin-bottom: auto; }
.cal-cell.today .cal-day { color: var(--accent); font-weight: 600; }
.cal-cell b { font: 600 14px 'IBM Plex Mono', monospace; color: var(--text); }
.cal-cell small, .cal-week small { font-size: 11px; color: var(--text-muted); }
.cal-week { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 10px; border-radius: 8px; background: var(--bg-secondary); }
.cal-week span { font-size: 11px; color: var(--text-dim); } .cal-week b { font: 600 13px 'IBM Plex Mono', monospace; }
.cal-summary .pos, .cal-week .pos { color: var(--green); } .cal-summary .neg, .cal-week .neg { color: var(--red); }
@media (max-width: 760px) { .cal-grid { grid-template-columns: repeat(7, 1fr); } .cal-week, .cal-head:nth-child(8) { display: none; } .cal-cell small { display: none; } .cal-summary { grid-template-columns: 1fr 1fr; } }

/* notebook */
#notebookView > div > div { border: 0 !important; border-radius: 10px !important; }
/* cards use <header>; keep the app bar's sticky dark styling off them */
.pf-card header, .pb-card header { position: static !important; background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border-bottom: 0 !important; height: auto !important; z-index: auto !important; }
.pb-card header { padding: 0 !important; }
#notebookContent { font: 14px/1.7 'IBM Plex Sans', sans-serif !important; }


/* ═══ Redesign · slice 6: Log trade form + trade details ═══════════ */
.modal { border: 1px solid var(--border) !important; border-radius: 12px !important; box-shadow: 0 24px 80px rgba(0,0,0,.5) !important; }
.modal-header { padding: 18px 22px !important; border-bottom: 1px solid var(--border) !important; }
.modal-title { font: 600 17px 'IBM Plex Sans', sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; }
.form-section { border: 0 !important; padding: 0 !important; margin-bottom: 26px !important; background: none !important; }
.form-section-title { font: 600 14px 'IBM Plex Sans', sans-serif !important; color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; margin-bottom: 14px !important; }
.form-section-title::after, .form-section-title::before { display: none !important; }
.form-group label, .modal label:not(.radio-option) { font: 500 12px 'IBM Plex Sans', sans-serif !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text-muted) !important; }
.modal input:not([type=radio]):not([type=checkbox]):not([type=file]), .modal select, .modal textarea {
  font: 14px 'IBM Plex Sans', sans-serif !important; border-radius: 8px !important; background: var(--bg-secondary) !important; border: 1px solid var(--border) !important; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color: var(--accent) !important; outline: none !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent) !important; }
.radio-option { border-radius: 8px !important; text-transform: none !important; letter-spacing: 0 !important; font: 500 13px 'IBM Plex Sans', sans-serif !important; }
.radio-option span { text-transform: none !important; letter-spacing: 0 !important; }
.radio-option:has(input:checked) { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, transparent) !important; color: var(--text) !important; }
.image-upload { border-radius: 10px !important; border-style: dashed !important; }
/* trade details: labels in sentence case, softer tags */
#viewTradeBody [style*="uppercase"] { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px !important; color: var(--text-muted) !important; }
#viewTradeBody [style*="border: 1px solid var(--red)"], #viewTradeBody [style*="border: 1px solid var(--accent)"] { border-radius: 999px !important; }


/* ═══ Prices & size ═══ */
.ec-price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ec-price-grid .ec-span2 { grid-column: span 2; }
@media (max-width: 640px) { .ec-price-grid { grid-template-columns: 1fr 1fr; } }
.td-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.td-prices > div { background: var(--bg-secondary); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.td-prices span { font-size: 12px; color: var(--text-muted); } .td-prices b { font: 600 14px 'IBM Plex Mono', monospace; }


/* ═══ Slice 8: simple form, details actions, screenshot markers, welcome ═══ */
.ec-basic { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.ec-basic > .form-section { margin-bottom: 4px !important; }
.ec-basic-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ec-basic-row:has(> :only-child) { grid-template-columns: 1fr; }
.ec-basic .form-group { margin: 0 !important; }
.ec-adv { border-top: 1px solid var(--border); padding-top: 14px; }
.ec-adv > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 6px 0; }
.ec-adv > summary::-webkit-details-marker { display: none; }
.ec-adv > summary span { font: 600 14px 'IBM Plex Sans', sans-serif; color: var(--text); }
.ec-adv > summary span::before { content: '+'; display: inline-block; width: 16px; color: var(--accent); }
.ec-adv[open] > summary span::before { content: '−'; }
.ec-adv > summary small { color: var(--text-dim); font-size: 12px; }
.ec-adv-body { padding-top: 16px; }
@media (max-width: 640px) { .ec-basic-row { grid-template-columns: 1fr; } }

.modal-actions .ec-danger:hover { color: var(--red) !important; border-color: var(--red) !important; }
.modal-actions { display: flex; gap: 8px; align-items: center; }

.ov-row { grid-template-columns: 64px 64px minmax(0, 1fr) 150px 64px 22px 96px !important; }
.ov-shot { display: grid; place-items: center; color: var(--text-dim); opacity: .55; }
.ov-shot.on { color: var(--accent); opacity: 1; }
@media (max-width: 760px) { .ov-row { grid-template-columns: 52px 56px minmax(0, 1fr) 22px 80px !important; } }

.ov-welcome { display: none; }
.ov-fresh .ov-welcome { display: block; }
.ov-fresh .ov-hero, .ov-fresh .ov-cal, .ov-fresh .ov-day { display: none; }
.ovw-head { padding: 8px 0 24px; }
.ovw-kicker { font: 500 12px 'IBM Plex Mono', monospace; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.ovw-head h2 { font: 600 30px/1.2 'IBM Plex Sans', sans-serif; letter-spacing: -0.02em; margin: 10px 0 8px; }
.ovw-head p { color: var(--text-muted); font-size: 15px; max-width: 560px; }
.ovw-cta { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.ovw-cta .btn { padding: 10px 18px !important; }
.ovw-cta span { color: var(--text-dim); font-size: 13px; }
.ovw-cta kbd { font: 11px 'IBM Plex Mono', monospace; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-muted); }
.ovw-steps { list-style: none; margin: 0 0 24px; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ovw-steps li { counter-increment: s; background: var(--surface); border-radius: 10px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.ovw-steps li::before { content: counter(s); font: 600 12px 'IBM Plex Mono', monospace; color: var(--accent); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); margin-bottom: 4px; }
.ovw-steps b { font: 600 14px 'IBM Plex Sans', sans-serif; }
.ovw-steps span { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.ovw-preview { position: relative; border: 1px dashed var(--border-light); border-radius: 10px; padding: 16px; }
.ovw-preview-label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 10px; }
.ovw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; opacity: .55; }
.ovw-grid i { font-style: normal; height: 58px; border-radius: 8px; background: var(--surface); padding: 7px 9px; display: flex; flex-direction: column; justify-content: space-between; font: 600 12.5px 'IBM Plex Mono', monospace; }
.ovw-grid em { font: 11px 'IBM Plex Sans', sans-serif; font-style: normal; color: var(--text-dim); }
.ovw-grid .up { background: color-mix(in srgb, var(--green) 18%, var(--surface)); color: var(--green); }
.ovw-grid .dn { background: color-mix(in srgb, var(--red) 16%, var(--surface)); color: var(--red); }
@media (max-width: 760px) { .ovw-steps { grid-template-columns: 1fr; } .ovw-head h2 { font-size: 24px; } }
.ov-card.soon .ov-bar i { background: var(--accent); }
/* screenshots in the basic form: one compact row, the drop zone above already explains pasting */
.ec-basic > .form-section > div[style*="grid-template-columns"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px !important; }
.ec-basic > .form-section > div[style*="font-size:0.7rem"] { display: none; }
.ec-basic .image-upload { min-height: 0 !important; padding: 10px !important; height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.ec-basic .image-upload .image-preview { max-height: 46px !important; width: 100%; object-fit: cover; border-radius: 4px; }
.ec-basic .image-upload [id^="uploadText"] { font-size: 12px !important; color: var(--text-dim); }
.ec-basic .image-upload button[id^="clearImg"] { margin-top: 4px !important; font-size: 10px !important; padding: 1px 6px !important; }
@media (max-width: 640px) { .ec-basic > .form-section > div[style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; } }


/* ═══ Slice 9: AI drop zone, empty month, motion ═══ */
.ec-ai-tag { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font: 600 10.5px 'IBM Plex Mono', monospace; letter-spacing: .07em;
  text-transform: uppercase; color: #fff; background: linear-gradient(90deg, #2563eb, #7c3aed); padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 0 18px rgba(99, 102, 241, .45); margin-bottom: 4px; }
.ec-ai-tag.sm { padding: 1px 7px; margin: 0; font-size: 10px; }
.ec-reader { border: 1px solid transparent !important; padding: 16px 18px !important;
  background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
              linear-gradient(110deg, #2563eb, #7c3aed, #22d3ee, #2563eb) border-box !important;
  background-size: 100% 100%, 300% 100% !important; animation: ecAiBorder 6s linear infinite;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, .08), 0 10px 40px -18px rgba(124, 58, 237, .55); }
.ec-reader:hover, .ec-reader.over { box-shadow: 0 0 0 1px rgba(99, 102, 241, .35), 0 12px 46px -14px rgba(124, 58, 237, .75); }
.ec-reader.busy { animation-duration: 1.6s; }
@keyframes ecAiBorder { to { background-position: 0 0, 300% 0; } }
.ec-reader-icon { width: 42px !important; height: 42px !important; border-radius: 10px !important; color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important; box-shadow: 0 6px 22px -6px rgba(124, 58, 237, .8); }
.ec-reader-text b { font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) { .ec-reader { animation: none; } }

/* empty month: dim the grid, card on top */
.ov-cal { position: relative; }
.ov-cal.is-empty > :not(.ov-cal-empty) { opacity: .32; }
.ov-cal.is-empty ~ .ov-day { display: none; }
.ov-cal-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) 70%, transparent), transparent 75%); }
.ov-cal-empty-card { max-width: 440px; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7); display: flex; flex-direction: column; gap: 8px; }
.ov-cal-empty-card b { font: 600 20px 'IBM Plex Sans', sans-serif; letter-spacing: -0.01em; }
.ov-cal-empty-card p { color: var(--text-muted); font-size: 14px; margin: 0; }
.ov-cal-empty-card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ov-cal-empty-card .recap { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 12.5px; color: var(--text-muted); }
.ov-cal-empty-card .recap b { font: 600 16px 'IBM Plex Mono', monospace; grid-row: span 2; align-self: center; }
.ov-cal-empty-card .recap .pos { color: var(--green); } .ov-cal-empty-card .recap .neg { color: var(--red); }

/* cursor glow + card spotlight */
#ecGlow { position: fixed; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%; pointer-events: none;
  z-index: -1; opacity: 0; transition: opacity .4s; will-change: transform;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%); }
.ec-lit { background-image: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%) !important; }
.ov-card, .chart-card, .pf-card, .pb-card, .ov-row, .cal-cell, .st-row, .ovw-steps li, .stat-card { transition: transform .2s ease, background-color .2s; }
.ov-card:hover, .pb-card:hover, .ovw-steps li:hover { transform: translateY(-2px); }
