/* Kite Terminal Design System v3
   Modern dark glassmorphic trading terminal theme with vibrant neon accents and crisp typography */

:root {
  /* Surface colors */
  --bg: #090c10;
  --bg-gradient: radial-gradient(circle at 50% 0%, #151c28 0%, #090c10 70%);
  --panel: #111620;
  --panel2: #161c28;
  --panel-elevated: #1a2232;
  --panel-hover: #1e2738;
  --soft: #0c1017;
  --line: rgba(255, 255, 255, 0.08);
  --line-hover: rgba(255, 255, 255, 0.16);
  --line-accent: rgba(56, 189, 248, 0.35);

  /* Typography */
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #8896ab;
  --text-dim: #64748b;

  /* Accent & Action Colors */
  --accent: #38bdf8;
  --accent-rgb: 56, 189, 248;
  --accent-d: rgba(56, 189, 248, 0.15);
  --accent-glow: 0 0 16px rgba(56, 189, 248, 0.3);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);

  /* Bullish / Win (Emerald) */
  --good: #22c55e;
  --good-rgb: 34, 197, 94;
  --good-d: rgba(34, 197, 94, 0.12);
  --good-glow: 0 0 16px rgba(34, 197, 94, 0.28);
  --good-gradient: linear-gradient(135deg, #15803d 0%, #22c55e 100%);

  /* Bearish / Loss (Rose / Crimson) */
  --bad: #f43f5e;
  --bad-rgb: 244, 63, 94;
  --bad-d: rgba(244, 63, 94, 0.12);
  --bad-glow: 0 0 16px rgba(244, 63, 94, 0.28);
  --bad-gradient: linear-gradient(135deg, #be123c 0%, #f43f5e 100%);

  /* Warning / Notice (Amber) */
  --warn: #f59e0b;
  --warn-d: rgba(245, 158, 11, 0.12);
  --warn-glow: 0 0 16px rgba(245, 158, 11, 0.25);

  /* Shapes & Effects */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--line);
  --shadow-card-hover: 0 8px 30px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--line-hover);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font: 13.5px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #263142; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #3a485e; }

.layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: 228px;
  background: rgba(14, 18, 26, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  padding: 16px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  z-index: 30;
}

.brand {
  padding: 2px 8px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.sim {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--warn);
  background: var(--warn-d);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .06em;
  margin-top: 6px;
}

.sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: .06em;
  margin-top: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  display: inline-block;
  animation: pulse-glow 2s infinite ease-in-out;
}

.pulse-dot.good {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.9); }
}

.tab {
  background: none;
  border: 0;
  color: var(--text-secondary);
  text-align: left;
  padding: 8px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  position: relative;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transform: translateX(2px);
}

.tab.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0.05) 100%);
  color: #38bdf8;
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.tab:hover .tab-icon,
.tab.active .tab-icon {
  opacity: 1;
}

.tab.active .tab-icon {
  color: var(--accent);
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.5));
}

.side-foot {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  padding: 10px 10px 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
}

.logout {
  margin-top: 6px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.logout:hover {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fff;
}

/* ==========================================================================
   Main Content & Top Header
   ========================================================================== */
main {
  flex: 1;
  padding: 18px 24px 36px;
  min-width: 0;
  position: relative;
}

/* Top Nav Bar */
.top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.bc-app {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .08em;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 7px;
  border-radius: 5px;
}

.bc-sep {
  color: var(--text-dim);
  font-weight: 300;
}

.bc-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-secondary);
}

.status-pill {
  border-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.clock-pill {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--muted);
  letter-spacing: .02em;
}

/* Pages */
.page { display: none; animation: fadeIn 0.15s ease-out; }
.page.active { display: block; }

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

h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #fff;
}

h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 20px 0 10px;
  color: #e2e8f0;
}

h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 16px 0 8px;
  color: #cbd5e1;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  margin: 6px 0;
  line-height: 1.5;
}

.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  padding: 10px 14px;
  border-radius: 8px;
  margin: 10px 0;
  white-space: pre-wrap;
  font-weight: 500;
}

.hidden { display: none !important; }

.summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  align-items: center;
}

.summary b {
  color: #fff;
  font-weight: 700;
}

/* ==========================================================================
   Buttons & Form Controls
   ========================================================================== */
button {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

button:hover {
  background: var(--panel-hover);
  border-color: var(--line-hover);
  color: #fff;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

button.primary {
  background: var(--accent-gradient);
  color: #041221;
  border: 0;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

button.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.45);
  color: #020b14;
}

button.danger {
  background: var(--bad-gradient);
  border: 0;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.3);
}

button.danger:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 16px rgba(244, 63, 94, 0.45);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

button.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

input, select, textarea {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
  background: #0f141d;
}

/* ==========================================================================
   Panels, Sections & Cards
   ========================================================================== */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 10px 0;
  box-shadow: var(--shadow-sm);
}

.panel-h {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.sect {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-card);
}

.sect-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.sect-t {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sect-s {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.card .k {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card .v {
  font-size: 20px;
  font-weight: 800;
  margin-top: 4px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   KPI Tiles (Trades, Performance, Dhan)
   ========================================================================== */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.tile:hover {
  border-color: var(--line-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.tile.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -4px rgba(56, 189, 248, 0.25);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, var(--panel) 100%);
}

.tile .n {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.tile .v {
  font-size: 26px;
  font-weight: 800;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.tile .m {
  font-size: 12px;
  color: var(--muted);
}

.tile .bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.22);
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.tile .bar i {
  display: block;
  height: 100%;
  background: var(--good-gradient);
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  transition: width 0.4s ease-out;
}

/* ==========================================================================
   Chart Panel & Visualizations
   ========================================================================== */
.chart-panel {
  padding: 14px 16px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.leg-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leg-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  display: inline-block;
}

.leg-dot.win { background: var(--good); }
.leg-dot.loss { background: var(--bad); }

.leg-line {
  width: 14px;
  height: 3px;
  border-radius: 1px;
  display: inline-block;
}

.leg-line.cum { background: var(--accent); }

.canvas-wrapper {
  position: relative;
  width: 100%;
}

#tr-curve {
  width: 100%;
  height: 200px;
  display: block;
  background: #0d1118;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 18, 26, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-accent);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  z-index: 10;
  min-width: 150px;
}

.tip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: 5px;
}

.tip-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 3px 0;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Tables & Data Grids
   ========================================================================== */
.scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
}

th, td {
  padding: 8px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

th {
  position: sticky;
  top: 0;
  background: #141a26;
  color: var(--muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  z-index: 2;
}

th:nth-child(2), td:nth-child(2) { text-align: left; }

td.sym {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  text-align: left;
}

td.sym a.kc {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: color 0.15s;
}

td.sym a.kc:hover {
  color: var(--accent);
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

tbody tr.sel {
  background: rgba(56, 189, 248, 0.12);
}

td.msg {
  text-align: left;
  white-space: normal;
  min-width: 260px;
}

.pos { color: var(--good); font-weight: 700; }
.neg { color: var(--bad); font-weight: 700; }

.st-ready, .st-success { color: var(--good); }
.st-blocked, .st-failed, .st-invalid { color: var(--bad); }
.st-already_active, .st-waiting_for_ltp, .st-checking { color: var(--warn); }

/* Chips & Badges */
.badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  display: inline-block;
}

.badge.buy {
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge.sell {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  background: var(--panel2);
  white-space: nowrap;
}

.chip.bull, .chip.good, .chip.ok {
  background: var(--good-d);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.35);
}

.chip.bear, .chip.bad {
  background: var(--bad-d);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.chip.warn {
  background: var(--warn-d);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.35);
}

.chip.info {
  background: var(--accent-d);
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.35);
}

.chip.mute {
  color: var(--muted);
}

/* ==========================================================================
   Trades Cards & Rows
   ========================================================================== */
.tgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 14px;
}

.tcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.tcard:hover {
  border-color: var(--line-hover);
  box-shadow: var(--shadow-card-hover);
}

.tcard.buy { border-left-color: var(--good); }
.tcard.sell { border-left-color: var(--bad); }

.th {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.th .s {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.big {
  margin-left: auto;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.kv b {
  color: var(--text);
  font-weight: 600;
}

.trow {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.trow:hover {
  background: var(--panel-hover);
  border-color: var(--line-hover);
}

.trow.win { border-left-color: var(--good); }
.trow.loss { border-left-color: var(--bad); }

.trow .top {
  display: grid;
  grid-template-columns: 210px minmax(260px, 1fr) 240px 180px 120px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
}

.trow .top .l .s {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.trow .top .pn {
  text-align: right;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.trow .top .pn small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.trow .detail {
  display: none;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  background: rgba(0, 0, 0, 0.2);
}

.trow.open .detail { display: block; }

.detail .g {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 18px;
  margin: 8px 0;
}

.detail .g div span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.lvs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.lv {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lv i {
  font-style: normal;
  color: var(--muted);
  font-size: 10.5px;
  margin-right: 5px;
  font-weight: 700;
}

.lv.thit {
  background: var(--good-d);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.lv.thit i { color: #86efac; }

.lv.slhit {
  background: var(--bad-d);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.lv.slhit i { color: #fda4af; }

.lv.slmoved {
  background: var(--warn-d);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fde68a;
}

/* ==========================================================================
   Options Lab & Payoff Diagram
   ========================================================================== */
.ol-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 12px 0;
  font-size: 13.5px;
  padding: 12px 16px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ol-stats b { color: #fff; font-weight: 700; }
.ol-stats span { color: var(--muted); }

.ol-chart {
  margin: 12px 0 20px;
  max-width: 800px;
}

.ol-chart svg {
  width: 100%;
  height: auto;
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ol-warn {
  color: #fde68a;
  background: var(--warn-d);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  margin: 8px 0;
}

/* ==========================================================================
   Orders & Trend: Grid, Board & Ladder
   ========================================================================== */
.otgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.otgrid .sect { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.ofm {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 12px;
  align-items: end;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.fld.hidden { display: none !important; }
.fld.span2 { grid-column: span 2; }
.fld.span4 { grid-column: span 4; }

.fl {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.fl.pos { color: var(--good); }
.fl.neg { color: var(--bad); }

.ofm input, .ofm select {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  width: 100%;
  min-width: 0;
}

.ofm input:focus, .ofm select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.ofm input[readonly] {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.btnrow.tight { margin-top: 0; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
  cursor: pointer;
}

.btn-bull {
  background: var(--good-d);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.btn-bull:hover {
  background: rgba(34, 197, 94, 0.22);
}

.btn-bear {
  background: var(--bad-d);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.btn-bear:hover {
  background: rgba(244, 63, 94, 0.22);
}

.or-mbuy {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.4);
  color: #86efac;
  font-weight: 700;
}

.or-msell {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fda4af;
  font-weight: 700;
}

/* Segmented controls */
.segctl {
  display: inline-flex;
  width: 100%;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 3px;
  gap: 3px;
}

.segctl button {
  flex: 1 1 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 7px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.segctl button:hover {
  color: var(--text);
  background: var(--panel2);
}

.segctl button.on {
  background: var(--accent-gradient);
  color: #041221;
  font-weight: 700;
}

.sidectl button.buy.on {
  background: var(--good-gradient);
  color: #fff;
}

.sidectl button.sell.on {
  background: var(--bad-gradient);
  color: #fff;
}

.sidectl button.buy:not(.on) { color: #86efac; }
.sidectl button.sell:not(.on) { color: #fda4af; }

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}

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

.sw {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #232c3b;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}

.sw::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}

.switch input:checked + .sw {
  background: var(--accent);
}

.switch input:checked + .sw::after {
  transform: translateX(16px);
  background: #fff;
}

/* Market board */
.board { display: flex; flex-direction: column; }

.brow {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(110px, .6fr) minmax(0, 3fr) minmax(130px, .8fr);
  gap: 12px 18px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.brow:first-child { border-top: 0; padding-top: 4px; }
.bsym b { font-size: 16px; color: #fff; }
.bsym > div + div { margin-top: 5px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }

.bpx { display: flex; flex-direction: column; line-height: 1.25; }
.bpx b { font-size: 18px; color: #fff; font-variant-numeric: tabular-nums; }
.bpx span { font-size: 12px; font-weight: 600; }

.gauge { position: relative; height: 54px; }
.gtrack {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #232c3b 35%, #232c3b 65%, #f43f5e);
  opacity: .85;
}

.gzone { position: absolute; top: 20px; height: 17px; border-radius: 4px; opacity: .6; }
.gzone.buy { background: #22c55e; }
.gzone.sell { background: #f43f5e; }
.gband { position: absolute; top: 22px; height: 13px; background: rgba(56, 189, 248, 0.15); border: 1px dashed #38bdf8; border-radius: 3px; }
.glv { position: absolute; top: 19px; width: 0; height: 19px; }
.glv i { position: absolute; left: -1px; top: 0; width: 3px; height: 19px; border-radius: 2px; }
.glv.buy i { background: var(--good); }
.glv.sell i { background: var(--bad); }

.gl { position: absolute; top: 41px; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gl.buy { color: var(--good); }
.gl.sell { color: var(--bad); }

.gnow { position: absolute; top: 6px; width: 0; height: 44px; }
.gnow::before { content: ""; position: absolute; left: -1px; top: 12px; width: 2px; height: 32px; background: var(--accent); }
.gnow::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--panel);
  box-sizing: border-box;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

.gnow span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -6px;
  background: #0d2847;
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Price ladder */
.ladder { position: relative; height: 210px; margin: 16px 4px 6px; }
.ladder .axis {
  position: absolute;
  left: 92px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f43f5e 0%, #232c3b 50%, #22c55e 100%);
  border-radius: 3px;
}

.ladder .band { position: absolute; left: 83px; width: 21px; background: rgba(56, 189, 248, 0.12); border-left: 1px dashed rgba(56, 189, 248, 0.4); border-right: 1px dashed rgba(56, 189, 248, 0.4); }
.ladder .mk { position: absolute; left: 0; right: 0; height: 36px; margin-top: -18px; display: flex; align-items: center; }
.ladder .mk .px { width: 80px; text-align: right; font-weight: 800; font-size: 15px; padding-right: 12px; font-variant-numeric: tabular-nums; }
.ladder .mk .dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--panel); position: relative; left: -6px; flex-shrink: 0; }
.ladder .mk .tx { margin-left: 12px; display: flex; flex-direction: column; line-height: 1.25; }
.ladder .mk .tx b { font-size: 12.5px; }
.ladder .mk .tx span { color: var(--muted); font-size: 11.5px; }
.ladder .mk.sell .dot { background: var(--bad); box-shadow: 0 0 8px rgba(244, 63, 94, 0.5); }
.ladder .mk.sell .px, .ladder .mk.sell .tx b { color: var(--bad); }
.ladder .mk.buy .dot { background: var(--good); box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.ladder .mk.buy .px, .ladder .mk.buy .tx b { color: var(--good); }
.ladder .mk.now .dot { background: var(--accent); box-shadow: 0 0 10px rgba(56, 189, 248, 0.7); }
.ladder .mk.now .px, .ladder .mk.now .tx b { color: var(--accent); }

/* Calls & Queues */
.calls { margin-top: 12px; }
.callrow {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) auto minmax(0, 2fr) auto;
  gap: 10px 14px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.callrow .csym { display: flex; align-items: center; gap: 8px; }
.callrow .csym b { font-size: 15px; color: #fff; }
.callrow .cnote { color: var(--muted); font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.callrow .cnote i { color: var(--text-dim); font-style: normal; font-size: 11px; display: block; margin-top: 2px; }

.tabs2 {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 14px 0 10px;
}

.tabs2 button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 9px 16px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.tabs2 button.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==========================================================================
   Bots, SMC, Performance & Others
   ========================================================================== */
.svc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--muted);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.svc.ok { border-left-color: var(--good); }
.svc.down { border-left-color: var(--bad); }
.svc.quiet { border-left-color: var(--warn); }

.svc .h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc .h .nm { font-size: 16px; font-weight: 800; color: #fff; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.down { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.dot.quiet { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

.svc .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 8px;
}

.svc .meta b { color: var(--text); font-weight: 600; }
.svc .acts { display: flex; gap: 8px; margin-top: 12px; }

/* SMC Recommendations & Grades */
.rec {
  display: inline-block;
  min-width: 54px;
  text-align: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .4px;
}

.rec.rec-buy { background: var(--good-d); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.4); }
.rec.rec-sell { background: var(--bad-d); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.4); }
.rec.rec-wait { background: var(--warn-d); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }
.rec.rec-avoid { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

.grade {
  display: inline-block;
  width: 22px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border-radius: 4px;
  font-weight: 800;
  font-size: 12px;
}

.grade.gA { background: var(--good-d); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.grade.gB { background: var(--warn-d); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.3); }
.grade.gC { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

.inzone {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #86efac;
  background: var(--good-d);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
}

.rngtag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fde68a;
  background: var(--warn-d);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
}

/* Performance Day Chips */
.dchip {
  display: inline-block;
  min-width: 64px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--line);
}

.dchip.R { background: #1a2230; color: #cbd5e1; }
.dchip.D { background: var(--bad-d); color: #fda4af; border-color: rgba(244, 63, 94, 0.35); }
.dchip.U { background: var(--good-d); color: #86efac; border-color: rgba(34, 197, 94, 0.35); }

.pf-both {
  background: var(--good-d);
  color: #86efac;
  padding: 3px 9px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

/* Auth & Banners */
.auth {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 9, 13, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.auth-box {
  width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.auth-t { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }

.idle-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: linear-gradient(90deg, #92400e, #b45309);
  color: #fff;
  text-align: center;
  padding: 9px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pause-banner {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-weight: 600;
}

/* Form specific & Tests expectations */
.or-form label.hidden, .or-form .hidden { display: none !important; }
.or-days button.on { background: var(--accent); color: #041221; font-weight: 700; border-color: var(--accent); }
.emptyrow { text-align: center !important; color: var(--muted); padding: 30px 14px !important; }

/* Mobile & Tablet Styles */
@media (max-width: 1000px) {
  .help-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .otgrid { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 0;
  }
  .brand { border-bottom: 0; padding: 0 10px 0 0; margin: 0; }
  .tab { white-space: nowrap; flex-shrink: 0; }
  .tab span { display: inline; }
  .side-foot { display: none; }
  main { padding: 12px; }
  .top-nav-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cards, .tiles, .tgrid { grid-template-columns: 1fr; }
  .trow .top { grid-template-columns: 1fr 1fr; }

  /* Cardify tables on small screens */
  .scroll { border: 0; overflow-x: visible; }
  table.cardify { min-width: 0; display: block; }
  table.cardify thead { display: none; }
  table.cardify tbody { display: block; }
  table.cardify tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 0 0 8px;
    padding: 10px 12px;
  }
  table.cardify td {
    display: block;
    border: 0;
    padding: 0;
    text-align: left;
    white-space: normal;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  table.cardify td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
  }
  table.cardify td[data-label=""]::before { display: none; }
  table.cardify td.sym, table.cardify td.msg, table.cardify td[colspan] { grid-column: 1 / -1; }
  table.cardify td:empty { display: none; }
}
