    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      margin: 0;
      padding: 0;
      background: #0f172a;
      color: #e5e7eb;
    }
    .app {
      max-width: 1000px;
      margin: 0 auto;
      padding: 24px;
    }
    h1 {
      font-size: 1.8rem;
      margin-bottom: 8px;
    }
    .brand-header {
      margin-bottom: 4px;
    }
    .brand-subtitle {
      margin-bottom: 10px;
    }
    .logo {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 800;
      letter-spacing: 0.6px;
    }
    .logo-badge {
      width: 30px;
      height: 30px;
      border-radius: 999px;
      background: conic-gradient(from 180deg, #38bdf8, #a855f7, #f97316, #38bdf8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.8rem;
      color: #020617;
      font-weight: 900;
    }
    h2 {
      font-size: 1.3rem;
      margin-top: 24px;
      margin-bottom: 8px;
    }
    .card {
      background: #020617;
      border-radius: 12px;
      padding: 16px 20px;
      box-shadow: 0 10px 25px rgba(0,0,0,0.4);
      margin-bottom: 16px;
      border: 1px solid #1f2937;
    }
    label {
      display: block;
      font-size: 0.9rem;
      margin-bottom: 4px;
      color: #9ca3af;
    }
    input {
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #374151;
      background: #020617;
      color: #e5e7eb;
      font-size: 0.95rem;
      margin-bottom: 10px;
    }
    select {
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #374151;
      background: #020617;
      color: #e5e7eb;
      font-size: 0.95rem;
      margin-bottom: 10px;
      display: block;
    }
    input:focus {
      outline: none;
      border-color: #38bdf8;
      box-shadow: 0 0 0 1px #38bdf8;
    }
    select:focus {
      outline: none;
      border-color: #38bdf8;
      box-shadow: 0 0 0 1px #38bdf8;
    }
    .select-control {
      width: 100%;
      display: block;
    }
    .auth-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }
    .auth-left {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 220px;
    }
    .auth-right {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    body.tier-pro #upgrade-plan,
    body.tier-pro #upgrade-btn {
      display: none !important;
    }
    #upgrade-plan {
      width: auto;
      min-width: 110px;
      margin-bottom: 0;
    }
    /* Keep Research Lab dropdowns visually identical even if stale HTML still has old classes */
    #research-interval,
    #research-range {
      width: 100% !important;
      height: 32px;
      padding: 5px 8px !important;
      border-radius: 8px !important;
      border: 1px solid #374151 !important;
      background: #020617 !important;
      color: #e5e7eb !important;
      font-size: 0.86rem !important;
      line-height: 1.2;
      display: block !important;
      appearance: auto;
      -webkit-appearance: menulist;
      margin-bottom: 10px !important;
      box-sizing: border-box;
    }
    button {
      border: none;
      border-radius: 999px;
      padding: 8px 16px;
      font-size: 0.95rem;
      cursor: pointer;
      background: #38bdf8;
      color: #0f172a;
      font-weight: 600;
      margin-right: 8px;
      margin-top: 4px;
    }
    button.secondary {
      background: #1f2937;
      color: #e5e7eb;
    }
    button.danger {
      background: #7f1d1d;
      color: #fee2e2;
    }
    button:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
    .row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 12px;
    }
    .pill {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 0.75rem;
      font-weight: 600;
    }
    .pill-medium {
      background: rgba(234,179,8,0.16);
      color: #eab308;
    }
    .pill-high {
      background: rgba(239,68,68,0.18);
      color: #f97316;
    }
    .pill-low {
      background: rgba(59,130,246,0.2);
      color: #60a5fa;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.9rem;
      margin-top: 8px;
    }
    th, td {
      border-bottom: 1px solid #1f2937;
      padding: 8px;
      text-align: left;
    }
    th {
      color: #9ca3af;
      font-weight: 500;
    }
    .status-bar {
      font-size: 0.85rem;
      color: #9ca3af;
      margin-top: 6px;
      min-height: 18px;
    }
    .status-bar span {
      opacity: 0.9;
    }

    .global-status {
      margin: 0 0 12px 0;
      padding: 10px 12px;
      border-radius: 10px;
      background: #111827;
      border: 1px solid #1f2937;
      color: #cbd5f5;
      font-size: 0.85rem;
      display: none;
    }
    .global-status.error {
      color: #f97373;
      border-color: #7f1d1d;
      background: rgba(127, 29, 29, 0.2);
    }
    .global-status.syncing {
      color: #cbd5f5;
      border-color: #334155;
      background: rgba(15, 23, 42, 0.8);
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }
    .sync-spinner {
      width: 12px;
      height: 12px;
      border: 2px solid #334155;
      border-top-color: #38bdf8;
      border-radius: 999px;
      animation: spin 0.9s linear infinite;
      flex: 0 0 auto;
    }
    .skeleton {
      background: linear-gradient(90deg, #0b1020 25%, #1f2937 50%, #0b1020 75%);
      background-size: 200% 100%;
      animation: shimmer 1.4s infinite;
      border-radius: 8px;
    }
    .skeleton-line {
      height: 10px;
      margin: 6px 0;
    }
    .skw-w-90 { width: 90%; }
    .skw-w-80 { width: 80%; }
    .skw-w-70 { width: 70%; }
    .skw-w-60 { width: 60%; }
    .skw-w-50 { width: 50%; }
    .skw-w-40 { width: 40%; }
    .skw-w-30 { width: 30%; }
    .skw-w-20 { width: 20%; }
    .skw-w-10 { width: 10%; }
    .skw-hidden-col { display: none; }
    .skw-note {
      font-size: 0.8rem;
      color: #9ca3af;
    }
    .skw-muted-85 {
      font-size: 0.85rem;
      color: #6b7280;
    }
    .subtle {
      font-size: 0.9rem;
      color: #9ca3af;
      margin: 6px 0 10px;
    }
    .skw-link-light {
      color: #e5e7eb;
      text-decoration: none;
    }
    .skw-mt-4 { margin-top: 4px; }
    .skw-mb-8 { margin-bottom: 8px; }
    .skw-overflow-x { overflow-x: auto; }
    .skw-table-compact {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }
    .skw-head-cell {
      text-align: left;
      border-bottom: 1px solid #1f2937;
      padding: 6px 4px;
    }
    .skw-cell {
      border-bottom: 1px solid #1f2937;
      padding: 6px 4px;
    }
    .skw-show-block { display: block !important; }
    .skw-show-inline-block { display: inline-block !important; }
    .skw-show-inline-flex { display: inline-flex !important; }
    .skw-show-table { display: table !important; }
    @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    @keyframes spin {
      from { transform: rotate(0deg); }
      to { transform: rotate(360deg); }
    }
    .status-bar .error {
      color: #f97373;
    }
    .profile-menu {
      position: relative;
      display: inline-flex;
    }
    .profile-btn {
      width: 34px;
      height: 34px;
      border-radius: 999px;
      border: 1px solid #1f2937;
      background: #0b1020;
      color: #e5e7eb;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .profile-dropdown {
      position: absolute;
      right: 0;
      top: 42px;
      min-width: 180px;
      background: #0b1020;
      border: 1px solid #1f2937;
      border-radius: 10px;
      box-shadow: 0 10px 24px rgba(0,0,0,0.4);
      padding: 6px;
      display: none;
      z-index: 30;
    }
    .profile-dropdown a,
    .profile-dropdown button {
      width: 100%;
      text-align: left;
      background: transparent;
      border: none;
      color: #e5e7eb;
      padding: 8px 10px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 0.85rem;
    }
    .profile-dropdown a:hover,
    .profile-dropdown button:hover {
      background: #111827;
    }
    .tag {
      font-size: 0.75rem;
      background: #111827;
      padding: 2px 6px;
      border-radius: 999px;
      border: 1px solid #1f2937;
      margin-left: 4px;
    }
    tr.selectable-row:hover {
      background: #111827;
      cursor: pointer;
    }
    tr.selected-row {
      background: #1f2937;
    }
    .research-grid {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 16px;
    }
    .chart-wrap {
      background: #0b1020;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 12px;
      position: relative;
    }
    #research-chart {
      width: 100%;
      height: 280px;
      display: block;
    }
    .macd-wrap {
      background: #0b1020;
      border: 1px solid #1f2937;
      border-radius: 12px;
      padding: 12px;
      margin-top: 12px;
    }
    #macd-chart {
      width: 100%;
      height: 185px;
      display: block;
    }
    .chart-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 0.8rem;
      color: #9ca3af;
      margin-top: 8px;
    }
    .legend-item {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: opacity 120ms ease, color 120ms ease;
    }
    .legend-swatch {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: #38bdf8;
    }
    .legend-price .legend-swatch { background: #38bdf8; }
    .legend-vwap .legend-swatch { background: #f97316; }
    .legend-ema20 .legend-swatch { background: #a855f7; }
    .legend-ema50 .legend-swatch { background: #22c55e; }
    .legend-sma50 .legend-swatch { background: #eab308; }
    .legend-sma200 .legend-swatch { background: #f472b6; }
    .legend-item.active {
      color: #e5e7eb;
      font-weight: 700;
      opacity: 1;
    }
    .legend-item.dim {
      opacity: 0.45;
    }
    #research-chart path.chart-series-active {
      stroke-width: 3.5 !important;
      opacity: 1 !important;
    }
    #research-chart path.chart-series-dim {
      opacity: 0.3;
    }
    .chart-hover-tooltip {
      position: absolute;
      z-index: 5;
      pointer-events: none;
      background: rgba(2, 6, 23, 0.95);
      border: 1px solid #334155;
      border-radius: 8px;
      color: #e5e7eb;
      font-size: 0.78rem;
      line-height: 1.25;
      padding: 6px 8px;
      box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
      white-space: nowrap;
    }
    .study-list {
      display: grid;
      gap: 10px;
    }
    .study-item {
      background: #0b1020;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 10px 12px;
      position: relative;
    }
    .study-item h4 {
      margin: 0 0 4px 0;
      font-size: 0.95rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .study-meta {
      font-size: 0.78rem;
      color: #9ca3af;
      margin-top: 2px;
    }
    .study-info {
      width: 18px;
      height: 18px;
      border-radius: 999px;
      border: 1px solid #1f2937;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      color: #9ca3af;
      cursor: pointer;
    }
    .study-tooltip {
      position: absolute;
      left: 12px;
      right: 12px;
      top: 40px;
      background: #111827;
      border: 1px solid #1f2937;
      border-radius: 10px;
      padding: 10px;
      font-size: 0.78rem;
      color: #cbd5f5;
      line-height: 1.35;
      z-index: 10;
      display: none;
      box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    }
    .study-tooltip strong {
      color: #e5e7eb;
      font-weight: 600;
    }
    .study-tooltip br {
      line-height: 1.55;
    }
    .toggle-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      font-size: 0.85rem;
      color: #cbd5f5;
      margin: 8px 0 4px 0;
    }
    .toggle-row label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 0;
      color: #cbd5f5;
    }
    .toggle-row input {
      width: auto;
      margin: 0;
    }
    .research-controls {
      margin: 8px 0 6px 0;
      display: flex;
      flex-wrap: wrap;
      align-items: flex-end;
      gap: 10px;
    }
    .research-controls > div {
      min-width: 0;
    }
    .research-controls .rc-symbol {
      flex: 0 0 140px;
      margin-right: 16px;
    }
    .research-controls .rc-interval,
    .research-controls .rc-range {
      flex: 0 0 94px;
    }
    .research-controls .rc-action {
      flex: 0 0 auto;
    }
    #research-symbol {
      width: 100%;
      max-width: 140px;
    }
    #research-load-btn {
      margin-top: 0;
      margin-right: 0;
      white-space: nowrap;
    }
    .main-layout {
      display: flex;
      align-items: flex-start;
      gap: 18px;
      flex-wrap: wrap;
    }
    .main-column {
      flex: 1;
      min-width: 0;
    }
    .news-rail {
      position: static;
      width: 230px;
      max-height: none;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      margin-bottom: 0;
    }
    .news-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .news-sub {
      font-size: 0.78rem;
      color: #9ca3af;
      margin-top: 2px;
    }
    .news-stream-controls {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
      margin: 6px 0 8px 0;
    }
    .news-input {
      flex: 1;
      min-width: 140px;
      margin-bottom: 0;
    }
    .news-list {
      display: grid;
      gap: 10px;
      overflow-y: auto;
      padding-right: 6px;
      flex: 1;
    }
    .news-list,
    div[style*="overflow-x:auto"] {
      -webkit-overflow-scrolling: touch;
    }
    .chart-wrap svg,
    .macd-wrap svg {
      max-width: 100%;
    }
    .news-item {
      border-bottom: 1px solid #1f2937;
      padding-bottom: 8px;
    }
    .news-item:last-child {
      border-bottom: none;
    }
    .news-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      font-size: 0.78rem;
      color: #9ca3af;
      margin-bottom: 4px;
    }
    .news-symbol {
      font-weight: 700;
      color: #e5e7eb;
      letter-spacing: 0.5px;
    }
    .news-title {
      font-size: 0.9rem;
      color: #e5e7eb;
      line-height: 1.3;
      margin-bottom: 4px;
    }
    .news-meta {
      font-size: 0.78rem;
      color: #9ca3af;
    }
    .news-target {
      color: #38bdf8;
      font-weight: 600;
    }
        body.logged-in #login-btn { display: none !important; }
    body.logged-in #profile-btn { display: inline-flex !important; }
    body.logged-in #profile-dropdown { display: none; }
    body.logged-out #profile-btn { display: none !important; }

@media (max-width: 780px) {
      .research-grid {
        grid-template-columns: 1fr;
      }
      .research-controls {
        align-items: stretch;
      }
    }
    @media (max-width: 900px) {
      .main-layout {
        flex-direction: column;
      }
    }
    @media (max-width: 980px) {
      .news-rail {
        width: 100%;
        max-height: none;
        margin-top: 16px;
      }
    }
    @media (max-width: 640px) {
      .app {
        padding: 16px;
      }
      h1 {
        font-size: 1.4rem;
      }
      .card {
        padding: 14px 16px;
      }
      .row {
        grid-template-columns: 1fr;
      }
      .news-rail {
        width: 100%;
        margin-top: 12px;
      }
      .news-stream-controls {
        flex-direction: column;
        align-items: stretch;
      }
      .news-input {
        width: 100%;
      }
      .toggle-row {
        gap: 8px;
      }
      .profile-dropdown {
        min-width: 150px;
      }
    }

