/* Paper trading — standalone stylesheet.
   The site's tailwind.css is a hand-purged subset containing only classes
   used elsewhere; reusing arbitrary Tailwind-style class names here silently
   renders unstyled (no rule exists). Kite/Zerodha-style trading UIs also
   need true green/red P&L semantics, which the site's theme.css intentionally
   remaps to the Action Blue / Warning Orange brand palette. So this page
   gets its own small, self-contained, fully-defined stylesheet instead of
   fighting either of those. No Node build step, same philosophy as the rest
   of the site. */

/* :root, not .pt-page, so the order modal (rendered as a sibling of
   .pt-page for correct fixed-position stacking) can also see these vars. */
:root {
  --pt-border: #E5E7EB; --pt-border-strong: #cfd4da; --pt-text: #1a1d23;
  --pt-text-muted: #6b7280; --pt-text-faint: #9aa1ab; --pt-bg-soft: #f7f9fb;
  --pt-accent: #1976D2; --pt-green: #00A65A; --pt-green-bg: rgba(0,166,90,.09);
  --pt-red: #E53935; --pt-red-bg: rgba(229,57,53,.09);
  --pt-orange: #FF6B35; --pt-orange-bg: rgba(255,107,53,.10);
}
.pt-page {
  max-width: 1400px; margin: 0 auto; padding: 0 16px 64px; color: var(--pt-text);
  font-size: 14px;
}
.pt-page h1 { font-size: 22px; font-weight: 700; color: var(--pt-text); }
.pt-page a { color: var(--pt-accent); }

/* ---- Kite-style app bar (logo, index ticker, nav, icons) ---- */
.pt-appbar { display: flex; align-items: center; gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--pt-border); border-top: none; flex-wrap: wrap; background: #fff; position: relative; z-index: 40; }
.pt-appbar-sticky { position: sticky; top: 0; z-index: 40; margin: 0 -16px; padding-left: 16px; padding-right: 16px; box-shadow: 0 1px 3px rgba(16,24,40,.05); background: #fff; }
.pt-appbar-logo { text-decoration: none; font-weight: 800; font-size: 15px; color: var(--pt-text); white-space: nowrap; line-height: 1.4; display: flex; align-items: center; position: relative; z-index: 2; }
.pt-ticker-strip { display: flex; align-items: center; gap: 16px; flex-wrap: nowrap; white-space: nowrap; padding: 4px 0; position: relative; z-index: 2; background: transparent; }
.pt-ticker-item { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-shrink: 0; white-space: nowrap; line-height: 1.4; }
.pt-ticker-label { font-weight: 700; color: var(--pt-text); line-height: 1.4; }
.pt-ticker-price { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; font-size: 13px; color: var(--pt-text); line-height: 1.4; }
.pt-ticker-chg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

.pt-header-pnl { 
  display: flex; align-items: center; gap: 8px; background: var(--pt-bg-soft); 
  padding: 4px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; flex-shrink: 0; 
}
.pt-header-pnl-label { color: var(--pt-text-muted); }
.pt-header-pnl-value { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.pt-appbar-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; flex-wrap: wrap; position: relative; z-index: 2; }
.pt-navlink { font-size: 13px; color: var(--pt-text-muted); font-weight: 600; cursor: pointer; padding: 4px 2px; border-bottom: 2px solid transparent; background: none; border-left: 0; border-right: 0; border-top: 0; }
.pt-navlink.active { color: var(--pt-accent); border-bottom-color: var(--pt-accent); }
.pt-navlink.disabled { color: var(--pt-text-faint); cursor: default; }
.pt-navlink .pt-soon { font-size: 8.5px; vertical-align: super; color: var(--pt-orange); font-weight: 700; margin-left: 2px; }
.pt-appbar-icons { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }
.pt-icon-btn { width: 18px; height: 18px; color: var(--pt-text-muted); }
.pt-avatar-circle { width: 26px; height: 26px; border-radius: 50%; background: var(--pt-accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

/* ---- Mobile app bar: logo+ticker share the top row, nav links+avatar share
   the row below. Flexbox with a forced line-break (not CSS Grid) — a shared
   grid column across both rows let the nav row's huge max-content width
   starve the logo's column, making the logo overflow on top of the ticker. */
@media (max-width: 768px) {
  .pt-appbar { flex-wrap: wrap; gap: 8px 8px; padding: 12px 16px 8px; }
  .pt-appbar-logo { order: 1; flex-shrink: 0; }
  .pt-ticker-strip { order: 2; flex: 1 1 auto; min-width: 0; justify-content: flex-end; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; background: transparent; gap: 4px; }
  .pt-ticker-strip::-webkit-scrollbar { display: none; }
  .pt-ticker-item { white-space: nowrap; flex-shrink: 0; gap: 2px; }
  .pt-ticker-label { font-size: 10px; }
  .pt-ticker-price { font-size: 11px; }
  .pt-ticker-chg { display: none; }
  /* Forces nav+avatar onto their own row, independent of nav's content width. */
  .pt-appbar::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .pt-appbar-nav { order: 4; margin-left: 0; }
  .pt-appbar-icons { order: 5; margin-left: auto; }
}

/* ---- App body: watchlist sidebar + main content ---- */
.pt-app-body { display: grid; grid-template-columns: 380px 1fr; gap: 0; align-items: start; margin-top: 0; border: 1px solid var(--pt-border); border-top: 0; }
@media (max-width: 900px) { .pt-app-body { grid-template-columns: 1fr; } }
.pt-watchlist { border-right: 1px solid var(--pt-border); padding: 12px; min-height: 200px; }
@media (max-width: 900px) {
  .pt-watchlist { border-right: 0; border-bottom: 1px solid var(--pt-border); }
  .pt-watchlist.pt-watchlist-inactive { display: none; }
}
.pt-watchlist-search { position: relative; display: flex; align-items: center; }
.pt-watchlist-search input { width: 100%; padding: 7px 60px 7px 30px; border: 1px solid var(--pt-border); border-radius: 6px; font-size: 12.5px; color: var(--pt-text); box-sizing: border-box; }
.pt-watchlist-search input:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px rgba(25,118,210,.12); }
.pt-watchlist-kbd { position: absolute; right: 8px; font-size: 10px; color: var(--pt-text-faint); border: 1px solid var(--pt-border); border-radius: 4px; padding: 1px 5px; pointer-events: none; }

.pt-search-results { position: relative; z-index: 30; margin-top: 6px; border: 1px solid var(--pt-border); border-radius: 6px;
  background: #fff; max-height: 480px; overflow-y: auto; box-shadow: 0 8px 20px rgba(16,24,40,.08); }
.pt-search-result { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; font-size: 12.5px; font-family: ui-sans-serif, system-ui, sans-serif;
  background: #fff; border: 0; border-bottom: 1px solid #f0f1f3; cursor: pointer; color: var(--pt-text); text-align: left; }
.pt-search-result:last-child { border-bottom: 0; }
.pt-search-result:hover { background: var(--pt-bg-soft); }
.pt-search-result-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pt-search-result-symbol { font-size: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-search-result-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.pt-search-result-ltp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pt-search-empty { padding: 10px; font-size: 12px; color: var(--pt-text-faint); }
.pt-watchlist-list { margin-top: 10px; }
.pt-watchlist-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid #f0f1f3; cursor: pointer; border-radius: 6px; }
.pt-watchlist-item:hover { background: var(--pt-bg-soft); }
.pt-watchlist-item:last-child { border-bottom: 0; }
.pt-watchlist-symbol { font-size: 13px; font-weight: 600; }
.pt-watchlist-right { text-align: right; }
.pt-watchlist-price { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.pt-watchlist-chg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; display: flex; align-items: center; gap: 2px; justify-content: flex-end; }
.pt-watchlist-empty { color: var(--pt-text-faint); font-size: 12px; padding: 10px 4px; }
.pt-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 14px; font-size: 11px; color: var(--pt-text-faint); }
.pt-pagination span { padding: 2px 6px; border-radius: 4px; }
.pt-pagination span.active { background: var(--pt-bg-soft); color: var(--pt-text); font-weight: 700; }

.pt-main { padding: 14px; }
.pt-main-section { display: none; }
.pt-main-section.active { display: block; }
.pt-positions-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pt-positions-header h2 { font-size: 16px; font-weight: 700; }
.pt-positions-search { width: 220px; }

.pt-checkbox { width: 20px; }
.pt-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--pt-accent); vertical-align: middle; }
.pt-row-disabled td { color: var(--pt-text-faint) !important; background: var(--pt-bg-soft); opacity: .65; }

/* Row action menu — clicking anywhere in a row opens a small dropdown near it
   (Kite-style). This is a SINGLE persistent element living outside the polled
   tables (see index.html), positioned via JS on open — not one-per-row. A
   per-row menu that lives inside the 500ms-polled table gets destroyed and
   recreated by every poll tick, which visibly flashes even when JS re-opens
   it immediately after: htmx's swap/settle can paint the closed frame first. */
.pt-row-menu-cell { text-align: right; width: 28px; }
.pt-kebab-btn { background: none; border: 0; padding: 4px; color: var(--pt-text-faint); border-radius: 5px; display: inline-flex; pointer-events: none; }
tr:hover .pt-kebab-btn { color: var(--pt-text); }
.pt-table tbody tr[onclick] { cursor: pointer; }
.pt-row-menu { display: none; flex-direction: column; position: fixed;
  background: #fff; border: 1px solid var(--pt-border); border-radius: 8px; box-shadow: 0 8px 20px rgba(16,24,40,.14);
  z-index: 200; min-width: 116px; padding: 4px; }
.pt-row-menu.open { display: flex; }
.pt-row-menu button { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; background: none;
  text-align: left; font-size: 12.5px; color: var(--pt-text); border-radius: 6px; cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif; white-space: nowrap; }
.pt-row-menu button:hover { background: var(--pt-bg-soft); }
.pt-row-menu button.danger { color: var(--pt-red); }
.pt-row-menu button svg { flex-shrink: 0; }

/* Bulk-select action bar (appears once >=1 checkbox is ticked) */
.pt-bulk-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 8px;
  background: rgba(25,118,210,.08); border: 1px solid rgba(25,118,210,.25); border-radius: 6px; font-size: 12.5px; color: var(--pt-text); }
.pt-bulk-action-btn { padding: 5px 12px; border-radius: 5px; border: 0; font-weight: 700; font-size: 12px; cursor: pointer; color: #fff; background: var(--pt-accent); }
.pt-bulk-action-btn.danger { background: var(--pt-red); }
.pt-bulk-action-btn:hover { filter: brightness(1.08); }

.pt-collapsible-btn { background: none; border: 0; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--pt-text); cursor: pointer;
  display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--pt-border); width: 100%; text-align: left; margin-top: 8px; }
.pt-collapsible-btn .pt-caret { transition: transform .15s ease; }
.pt-collapsible-btn.open .pt-caret { transform: rotate(180deg); }
.pt-collapsible-body { padding: 8px 0 16px; }

.pt-breakdown-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.pt-breakdown-track { flex: 1; height: 10px; background: var(--pt-bg-soft); border-radius: 5px; overflow: hidden; }
.pt-breakdown-fill { height: 100%; border-radius: 5px; }
.pt-breakdown-fill.profit { background: var(--pt-accent); }
.pt-breakdown-fill.loss { background: var(--pt-orange); }
.pt-breakdown-label { width: 220px; font-size: 12px; color: var(--pt-text-muted); flex-shrink: 0; }
.pt-breakdown-value { width: 90px; text-align: right; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; flex-shrink: 0; }

.pt-topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--pt-border); margin-bottom: 16px; }
.pt-topbar-sub { color: var(--pt-text-muted); font-size: 13px; margin-top: 2px; }
.pt-avatar { width: 26px; height: 26px; border-radius: 50%; }

.pt-profile { position: relative; }
.pt-profile-trigger { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; border-radius: 50%; }
.pt-profile-menu { position: absolute; top: calc(100% + 10px); right: 0; width: 220px; background: #fff;
  border: 1px solid var(--pt-border); border-radius: 8px; box-shadow: 0 12px 28px rgba(16,24,40,.18);
  padding: 12px; z-index: 110; font-family: ui-sans-serif, system-ui, sans-serif; }
.pt-profile-menu-name { font-size: 13px; font-weight: 700; color: var(--pt-text); }
.pt-profile-menu-email { font-size: 11px; color: var(--pt-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-profile-menu-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px;
  color: var(--pt-text-muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pt-border); }
.pt-profile-pnl-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--pt-text); }
.pt-profile-menu-logout { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--pt-border);
  color: var(--pt-red); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.pt-profile-menu-logout:hover { text-decoration: underline; }

.pt-header-pnl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: baseline; gap: 6px; font-size: 13px; white-space: nowrap; }
.pt-header-pnl-label { font-weight: 700; color: var(--pt-text-muted); }
.pt-header-pnl-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 14px; }

.pt-up { color: var(--pt-green) !important; }
.pt-down { color: var(--pt-red) !important; }
.pt-flat { color: var(--pt-text-muted) !important; }

.pt-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .pt-layout { grid-template-columns: 1fr; } }

.pt-panel { border: 1px solid var(--pt-border); border-radius: 8px; background: #fff; padding: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.pt-panel-sticky { position: sticky; top: 84px; }
.pt-panel h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }

.pt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.pt-instrument-tabs { display: inline-flex; border: 1px solid var(--pt-border); border-radius: 6px; overflow: hidden; }
.pt-instrument-btn, .pt-tab-btn { padding: 6px 14px; font-size: 13px; background: #fff; color: var(--pt-text-muted);
  border: 0; border-right: 1px solid var(--pt-border); cursor: pointer; }
.pt-instrument-btn:last-child, .pt-tab-btn:last-child { border-right: 0; }
.pt-instrument-btn.active, .pt-tab-btn.active { background: var(--pt-accent); color: #fff; }
.pt-select { padding: 6px 10px; border: 1px solid var(--pt-border); border-radius: 6px; font-size: 13px; color: var(--pt-text); background: #fff; }
.pt-spot { margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--pt-text-muted); }

.pt-search-wrap { position: relative; margin-bottom: 10px; }
.pt-search-input { width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--pt-border); border-radius: 6px;
  font-size: 13px; color: var(--pt-text); background: #fff; }
.pt-search-input:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px rgba(0,87,243,.12); }
.pt-search-input::placeholder { color: var(--pt-text-faint); }
.pt-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--pt-text-faint); pointer-events: none; }

.pt-table-wrap { overflow-x: auto; overflow-y: visible; } /* explicit overflow-y so row-menu dropdowns aren't clipped */
.pt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pt-table th { text-align: left; font-weight: 700; color: var(--pt-text-faint); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .03em; padding: 6px 8px; border-bottom: 1px solid var(--pt-border); white-space: nowrap; }
.pt-table th.pt-r, .pt-table td.pt-r { text-align: right; }
.pt-table th.pt-c, .pt-table td.pt-c { text-align: center; }
.pt-table td { padding: 7px 8px; border-bottom: 1px solid #eef0f2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--pt-text); }
.pt-table tbody tr:hover { background: var(--pt-bg-soft); }
.pt-table tfoot td { border-top: 2px solid var(--pt-border); border-bottom: 0; font-weight: 700; padding-top: 10px; }

/* Responsive Grid Tables for Mobile */
@media (max-width: 768px) {
  .pt-table-wrap.pt-mobile-cards { overflow-x: visible; }
  .pt-table-wrap.pt-mobile-cards tbody, .pt-table-wrap.pt-mobile-cards tr, .pt-table-wrap.pt-mobile-cards td { display: block; border: 0; padding: 0; }
  .pt-table-wrap.pt-mobile-cards thead, .pt-hide-mobile { display: none !important; }
  .pt-table-wrap.pt-mobile-cards tbody tr {
    display: grid;
    border: 1px solid var(--pt-border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
  }
  .pt-table-wrap.pt-mobile-cards tbody tr:hover { background: #fff; }
  .pt-table-wrap.pt-mobile-cards td {
    display: flex; flex-direction: column; justify-content: center;
    text-align: left !important; line-height: 1.4;
  }
  .pt-table-wrap.pt-mobile-cards td::before {
    display: none !important;
  }
  .pt-table-wrap.pt-mobile-cards td:empty { display: none; }
  .pt-table-wrap.pt-mobile-cards td.pt-r { align-items: flex-end; text-align: right !important; }
  .pt-table-wrap.pt-mobile-cards td.pt-c { align-items: center; text-align: center !important; }
  
  /* Positions Grid — Clean Left/Right separation with explicit middle gap, hide checkboxes & avg price */
  .pt-mobile-pos tr {
    grid-template-columns: auto auto 1fr auto;
    grid-template-areas:
      "inst inst inst pnl"
      "prod qty  .    ltp";
    column-gap: 12px;
    row-gap: 12px;
    align-items: center;
    padding: 14px 14px;
  }
  .pt-mobile-pos td[data-col="chk"],
  .pt-mobile-pos td[data-col="avg"] { display: none !important; }
  
  .pt-mobile-pos td[data-col="inst"] { grid-area: inst; font-weight: 700; font-size: 14px; align-items: flex-start !important; text-align: left !important; }
  .pt-mobile-pos td[data-col="inst"]::before { content: none; }
  
  .pt-mobile-pos td[data-col="prod"] { grid-area: prod; align-items: flex-start !important; text-align: left !important; }
  .pt-mobile-pos td[data-col="qty"] { grid-area: qty; font-weight: 600; font-size: 13px; align-items: flex-start !important; text-align: left !important; }
  .pt-mobile-pos td[data-col="qty"]::before { content: "Qty: "; color: var(--pt-text-muted); font-size: 11px; display: inline !important; }
  
  .pt-mobile-pos td[data-col="pnl"] { grid-area: pnl; align-items: flex-end !important; text-align: right !important; font-weight: 700; font-size: 15px; }
  .pt-mobile-pos td[data-col="pnl"]::before { content: none; }
  
  .pt-mobile-pos td[data-col="ltp"] { grid-area: ltp; align-items: flex-end !important; text-align: right !important; font-weight: 600; color: var(--pt-text-muted); font-size: 13px; }
  .pt-mobile-pos td[data-col="ltp"]::before { content: "LTP "; font-weight: 500; font-size: 11px; display: inline !important; }
  
  /* Orders Grid — Clean Left/Right separation with explicit middle gap, hide checkboxes, time, & LTP */
  .pt-mobile-ord tr {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas:
      "type inst . status menu"
      "prod qty  . prc    menu";
    column-gap: 12px;
    row-gap: 12px;
    align-items: center;
    padding: 14px 14px;
  }
  .pt-mobile-ord td[data-col="chk"],
  .pt-mobile-ord td[data-col="time"],
  .pt-mobile-ord td[data-col="ltp"] { display: none !important; }
  
  .pt-mobile-ord td[data-col="type"] { grid-area: type; align-items: flex-start !important; }
  .pt-mobile-ord td[data-col="type"]::before { content: none; }
  
  .pt-mobile-ord td[data-col="inst"] { grid-area: inst; font-weight: 700; font-size: 14px; align-items: flex-start !important; text-align: left !important; }
  .pt-mobile-ord td[data-col="inst"]::before { content: none; }
  
  .pt-mobile-ord td[data-col="prod"] { grid-area: prod; align-items: flex-start !important; }
  .pt-mobile-ord td[data-col="qty"] { grid-area: qty; font-weight: 600; font-size: 13px; align-items: flex-start !important; text-align: left !important; }
  .pt-mobile-ord td[data-col="qty"]::before { content: "Qty: "; color: var(--pt-text-muted); font-size: 11px; display: inline !important; }
  
  .pt-mobile-ord td[data-col="status"] { grid-area: status; align-items: flex-end !important; text-align: right !important; }
  .pt-mobile-ord td[data-col="status"]::before { content: none; }
  
  .pt-mobile-ord td[data-col="prc"] { grid-area: prc; align-items: flex-end !important; text-align: right !important; font-weight: 600; font-size: 13px; }
  .pt-mobile-ord td[data-col="prc"]::before { content: "Price: "; color: var(--pt-text-muted); font-size: 11px; display: inline !important; }
  
  .pt-mobile-ord td[data-col="menu"] { grid-area: menu; align-self: center; justify-self: end; }
  .pt-mobile-ord td[data-col="menu"]::before { content: none; }
  
  /* Leaderboard Grid */
  .pt-mobile-lb tr {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "rank trader pnl"
      "rank .      funds";
    gap: 8px;
    align-items: center;
  }
  .pt-mobile-lb td[data-col="rank"] { grid-area: rank; padding-right: 8px; }
  .pt-mobile-lb td[data-col="rank"]::before { content: none; }
  .pt-mobile-lb td[data-col="trader"] { grid-area: trader; }
  .pt-mobile-lb td[data-col="trader"]::before { content: none; }
  .pt-mobile-lb td[data-col="trades"] { grid-area: trades; }
  .pt-mobile-lb td[data-col="funds"] { grid-area: funds; }
  .pt-mobile-lb td[data-col="pnl"] { grid-area: pnl; }
  .pt-mobile-lb td[data-col="pnl"]::before { content: none; }

  /* Leaderboard stays inside the single surrounding .pt-panel — rows are
     plain divided list items, not individually boxed cards like orders/positions. */
  .pt-table-wrap.pt-mobile-cards .pt-mobile-lb tbody tr {
    border: 0; border-radius: 0; margin-bottom: 0; box-shadow: none;
    padding: 10px 2px; background: transparent; border-bottom: 1px solid #f0f1f3;
  }
  .pt-table-wrap.pt-mobile-cards .pt-mobile-lb tbody tr:last-child { border-bottom: 0; }
}
.pt-strike-cell { text-align: center; font-weight: 700; background: var(--pt-bg-soft); }
.pt-atm-row td { background: rgba(25,118,210,.06); }
.pt-atm-row .pt-strike-cell { background: rgba(25,118,210,.14); }
.pt-badge-atm { background: var(--pt-accent); color: #fff; margin-left: 4px; }
.pt-itm { background: rgba(0,166,90,.07); }
.pt-muted { color: var(--pt-text-faint); }
.pt-empty { color: var(--pt-text-muted); font-size: 13px; padding: 8px 0; }

.pt-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .02em; font-family: ui-sans-serif, system-ui, sans-serif; }
.pt-badge-paper { background: rgba(0,87,243,.10); color: var(--pt-accent); }
.pt-badge-buy { background: var(--pt-green-bg); color: var(--pt-green); }
.pt-badge-sell { background: var(--pt-red-bg); color: var(--pt-red); }
.pt-badge-pending { background: #fdf1d6; color: #9a6b00; }
.pt-badge-executed { background: var(--pt-green-bg); color: var(--pt-green); }
.pt-badge-cancelled { background: #ececec; color: #666; }
.pt-badge-rejected { background: var(--pt-red-bg); color: var(--pt-red); }

.pt-btn-trade { padding: 2px 9px; font-size: 10px; font-weight: 600; border-radius: 4px; border: 1px solid var(--pt-border);
  background: var(--pt-bg-soft); color: var(--pt-text); cursor: pointer; font-family: ui-sans-serif, system-ui, sans-serif; }
.pt-btn-trade:hover { background: rgba(0,87,243,.08); border-color: var(--pt-accent); color: var(--pt-accent); }

/* Option chain: compact, solid-filled Buy/Sell, hover-only. No transition on
   opacity — the chain polls every 500ms and re-inserts this DOM node each
   time; an animated fade-in restarting every cycle is what read as "blinking",
   not the hover-reveal itself. An instant (untransitioned) toggle doesn't. */
.pt-chain-actions-cell { width: 60px; padding: 4px 6px !important; }
.pt-chain-actions { display: flex; gap: 4px; opacity: 0; }
.pt-chain-actions .pt-btn-trade { padding: 5px 9px; min-width: 26px; font-size: 12px; }
/* Reveal on hover anywhere across that side's cells (OI/LTP/actions), not
   just the narrow actions cell itself — hovering the OI or LTP number for a
   contract should surface its Buy/Sell same as hovering the buttons' own cell. */
tr:has(.pt-chain-call-cell:hover) .pt-chain-call-cell .pt-chain-actions,
tr:has(.pt-chain-put-cell:hover) .pt-chain-put-cell .pt-chain-actions { opacity: 1; }
@media (max-width: 768px) {
  .pt-chain-actions { opacity: 1; margin-bottom: 0; gap: 3px; justify-content: center; }
  .pt-chain-actions-cell { width: 42px !important; padding: 2px !important; }
  .pt-chain-actions .pt-btn-trade { padding: 3px 5px; min-width: 20px; font-size: 10.5px; line-height: 1.2; }
  .pt-chain-modal { width: 98vw; max-width: 98vw; max-height: 92vh; margin: 0 auto; }
  .pt-chain-modal-body { padding: 8px 4px 14px; }
  #oc-table { font-size: 11px; width: 100%; }
  #oc-table tbody tr { border-bottom: 2px solid var(--pt-border); }
  #oc-table th { padding: 6px 3px; }
  #oc-table td { padding: 10px 3px; }
  #oc-table .pt-strike-cell { width: 52px !important; padding: 10px 2px !important; }
  #oc-table .pt-strike-cell div { padding: 3px 6px !important; font-size: 11px !important; }
}
.pt-btn-trade.buy { background: #3b82f6; border-color: #3b82f6; color: #fff; } /* Sensibull B blue */
.pt-btn-trade.buy:hover { background: #2563eb; }
.pt-btn-trade.sell { background: #f97316; border-color: #f97316; color: #fff; } /* Sensibull S orange */
.pt-btn-trade.sell:hover { background: #ea580c; }
.pt-btn-link { background: none; border: 0; padding: 0; font-size: 11px; color: var(--pt-text-faint); text-decoration: underline; cursor: pointer; }
.pt-btn-link:hover { color: var(--pt-red); }

.pt-side-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pt-side-btn { padding: 9px; border-radius: 6px; border: 1px solid var(--pt-border); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.pt-side-btn.buy { color: var(--pt-green); border-color: var(--pt-green); }
.pt-side-btn.buy.active { background: var(--pt-green); color: #fff; }
.pt-side-btn.sell { color: var(--pt-red); border-color: var(--pt-red); }
.pt-side-btn.sell.active { background: var(--pt-red); color: #fff; }
.pt-side-btn:disabled, .pt-order-select:disabled { opacity: .55; cursor: not-allowed; }

.pt-field-label { display: block; font-size: 11px; color: var(--pt-text-muted); margin-bottom: 4px; font-weight: 600; }
.pt-input, .pt-order-select { width: 100%; padding: 7px 10px; border: 1px solid var(--pt-border); border-radius: 6px; font-size: 13px; margin-bottom: 12px; color: var(--pt-text); box-sizing: border-box; }
.pt-input:focus, .pt-order-select:focus { outline: none; border-color: var(--pt-accent); box-shadow: 0 0 0 3px rgba(0,87,243,.12); }
.pt-symbol-label { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 14px; color: var(--pt-text); }
.pt-ltp-label { color: var(--pt-text-muted); font-size: 12px; }
.pt-submit-btn { width: 100%; padding: 10px; border-radius: 6px; border: 0; font-weight: 700; font-size: 13px; color: #fff; cursor: pointer; }
.pt-submit-btn.buy { background: var(--pt-green); }
.pt-submit-btn.sell { background: var(--pt-red); }
.pt-error { color: var(--pt-red); font-size: 12px; margin-bottom: 8px; }
.pt-hidden { display: none !important; }

.pt-tabbar { display: flex; gap: 6px; border-bottom: 1px solid var(--pt-border); margin-bottom: 14px; }
.pt-tabbar button { background: none; border: 0; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--pt-text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; transition: all 0.15s ease; }
.pt-tabbar button:hover { color: var(--pt-text); background: var(--pt-bg-soft); }
.pt-tabbar button.active { color: var(--pt-accent); border-bottom-color: var(--pt-accent); font-weight: 700; }

/* ---- Option chain overlay (opened from the watchlist, floats above any tab) ---- */
.pt-chain-modal { width: 780px; max-width: 96vw; max-height: 95vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px rgba(16,24,40,.25); }
.pt-chain-modal-body { overflow: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 16px; overflow-anchor: auto; }
.pt-chain-modal-body .pt-table-wrap { overflow: visible; }

/* ---- Order ticket modal ---- */
.pt-modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding-top: 20px; }
.pt-modal { width: 380px; max-width: 92vw; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 20px 40px rgba(16,24,40,.25); }
.pt-modal-header { padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; color: #fff; background: var(--pt-green); cursor: move; user-select: none; }
.pt-modal-header .pt-modal-close { cursor: pointer; }
.pt-modal-header.sell { background: var(--pt-red); }
.pt-modal-symbol { font-weight: 700; font-size: 15px; }
.pt-modal-sub { font-size: 11.5px; opacity: .9; margin-top: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pt-modal-close { background: none; border: 0; color: #fff; font-size: 14px; cursor: pointer; opacity: .85; }
.pt-modal-close:hover { opacity: 1; }
.pt-modal-body { padding: 16px; }
.pt-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-modal-margin { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--pt-text-muted); margin: 4px 0 12px; }
.pt-modal-margin strong { color: var(--pt-text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pt-modal-actions { display: flex; gap: 8px; }
.pt-modal-actions .pt-submit-btn { flex: 1; }
.pt-modal-cancel { flex: 1; padding: 10px; border-radius: 6px; border: 1px solid var(--pt-border); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--pt-text-muted); }
.pt-modal-cancel:hover { background: var(--pt-bg-soft); }

/* ---- Dashboard ---- */
.pt-dash-section { border: 1px solid var(--pt-border); border-radius: 8px; background: #fff; padding: 12px 14px; margin-bottom: 12px; }
.pt-dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pt-dash-section h3 { font-size: 12.5px; font-weight: 700; color: var(--pt-accent); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .03em; }
.pt-dash-header h3 { margin-bottom: 0; }
.pt-dash-actions { display: flex; gap: 8px; }
.pt-dash-btn { padding: 6px 14px; border-radius: 6px; border: 0; font-weight: 700; font-size: 11.5px; color: #fff; cursor: not-allowed; opacity: .55; }
.pt-dash-btn-add { background: var(--pt-green); }
.pt-dash-btn-withdraw { background: var(--pt-accent); }
.pt-dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
@media (max-width: 700px) { 
  .pt-dash-tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; } 
  .pt-dash-tile { padding: 10px 4px; }
  .pt-dash-tile-value { font-size: 14.5px; margin-bottom: 4px; }
}
.pt-dash-tile { padding: 8px 4px; border-radius: 6px; background: var(--pt-bg-soft); }
.pt-dash-tile-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; color: var(--pt-text); }
.pt-dash-tile-label { font-size: 10.5px; color: var(--pt-text-muted); margin-top: 3px; }

/* ---- MIS / NORMAL product type switch toggle ---- */
.pt-product-switch-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; user-select: none; }
.pt-product-label { font-weight: 600; font-size: 11.5px; color: var(--pt-text-muted); cursor: pointer; transition: color .15s; }
.pt-product-label.active { color: var(--pt-orange); font-weight: 700; }
.pt-product-slider { 
  width: 44px; height: 24px; border-radius: 12px; background: var(--pt-orange);
  position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0;
}
.pt-product-slider-thumb { 
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; 
  background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s cubic-bezier(0.4, 0.0, 0.2, 1); pointer-events: none;
}
.pt-product-switch-wrap[data-product="NORMAL"] .pt-product-slider-thumb { transform: translateX(20px); }
.pt-product-switch-wrap[data-product="NORMAL"] .pt-product-slider { background: var(--pt-accent); }
.pt-product-switch-wrap[data-product="NORMAL"] .pt-product-label.active { color: var(--pt-accent); }
.pt-product-switch-wrap.disabled { opacity: 0.55; pointer-events: none; }

/* MIS / NORMAL badges in orders + positions tables */
.pt-badge-mis { background: rgba(255,107,53,.12); color: var(--pt-orange); }
.pt-badge-normal { background: rgba(25,118,210,.10); color: var(--pt-accent); }

/* ---- Leaderboard ---- */
.pt-lb-rank { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; font-weight: 700; font-size: 11.5px; color: var(--pt-text-muted); background: var(--pt-bg-soft); }
.pt-lb-rank-1 { background: #fdf1d6; color: #9a6b00; }
.pt-lb-rank-2 { background: #eceff1; color: #546e7a; }
.pt-lb-rank-3 { background: #fbe4d5; color: #a5502a; }
.pt-lb-trader { display: flex; align-items: center; gap: 8px; }
.pt-lb-name { font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 600; font-size: 12.5px; color: var(--pt-text); }
.pt-lb-row-self { background: rgba(25,118,210,.05); }
.pt-lb-row-self:hover { background: rgba(25,118,210,.09) !important; }
.pt-lb-ls { display: flex; align-items: center; gap: 8px; }
.pt-lb-ls-track { width: 70px; height: 8px; border-radius: 4px; background: var(--pt-red-bg); overflow: hidden; flex-shrink: 0; }
.pt-lb-ls-long { height: 100%; background: var(--pt-green); }

/* Profile menu link styling */
.pt-profile-menu-link { text-decoration: none; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; padding: 8px !important; margin: 6px -4px 0 !important; }
.pt-profile-menu-link:hover { background: var(--pt-bg-soft); }

/* ---- Historical PnL page ---- */
.pnl-page { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }

/* Stats row styling */
.pnl-stats-row { display: flex; flex-wrap: wrap; gap: 24px; padding: 20px 0; border-top: 1px solid var(--pt-border); border-bottom: 1px solid var(--pt-border); margin-bottom: 24px; }
.pnl-stat-item { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--pt-border); padding-left: 20px; }
.pnl-stat-item:first-child { border-left: none; padding-left: 0; }
.pnl-stat-label { font-size: 11px; font-weight: 600; color: var(--pt-text-muted); text-transform: none; }
.pnl-stat-sub { font-size: 10px; color: var(--pt-text-faint); margin-top: -2px; margin-bottom: 2px; }
.pnl-stat-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 800; color: var(--pt-text); }
.pnl-stat-streak-wrap { display: flex; align-items: center; gap: 10px; }
.pnl-streak-circle { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #E5E7EB; border-top-color: var(--pt-green); position: relative; display: flex; align-items: center; justify-content: center; }

/* Header with Avatar and Net Realised PnL */
.pnl-header-block { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; flex-wrap: wrap; gap: 20px; }
.pnl-user-info { display: flex; align-items: center; gap: 12px; }
.pnl-large-avatar { width: 64px; height: 64px; border-radius: 50%; background: #dbeafe; display: flex; align-items: center; justify-content: center; color: var(--pt-accent); font-size: 28px; font-weight: 400; }
.pnl-masked-name { font-size: 18px; color: var(--pt-text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.pnl-net-pnl { text-align: right; }
.pnl-net-label { font-size: 12px; color: var(--pt-text-muted); margin-bottom: 4px; }
.pnl-net-dates { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-bottom: 4px; }
.pnl-net-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; font-weight: 800; color: var(--pt-green); }

/* Heatmap Grid */
.pnl-heatmap-wrapper { display: flex; justify-content: center; overflow-x: auto; padding: 20px 0; }
.pnl-heatmap { display: flex; gap: 4px; font-family: ui-sans-serif, system-ui, sans-serif; }
.pnl-heatmap-months { display: flex; height: 20px; margin-bottom: 4px; position: relative; margin-left: 20px; }
.pnl-month-label { position: absolute; font-size: 10px; color: var(--pt-text-muted); }
.pnl-heatmap-body { display: flex; gap: 4px; }
.pnl-weekdays { display: flex; flex-direction: column; justify-content: space-between; width: 20px; font-size: 10px; color: var(--pt-text-faint); padding-top: 8px; text-align: right; margin-right: 4px; }
.pnl-heatmap-week { display: flex; flex-direction: column; gap: 4px; }
.pnl-heatmap-day { width: 14px; height: 14px; border-radius: 2px; background: #ebedf0; position: relative; cursor: crosshair; }
.pnl-heatmap-day:hover { outline: 1px solid rgba(0,0,0,0.2) !important; outline-offset: -1px; }
.pnl-heatmap-day.empty { background: transparent; pointer-events: none; }

/* Color scales for heatmap */
.pnl-heat-loss-4 { background: #E53935; }
.pnl-heat-loss-3 { background: #ef5350; }
.pnl-heat-loss-2 { background: #e57373; }
.pnl-heat-loss-1 { background: #ef9a9a; }
.pnl-heat-flat   { background: #ebedf0; }
.pnl-heat-profit-1 { background: #c6e48b; }
.pnl-heat-profit-2 { background: #7bc96f; }
.pnl-heat-profit-3 { background: #239a3b; }
.pnl-heat-profit-4 { background: #196127; }

/* Equity Block */
.pnl-equity-block { margin: 40px auto; max-width: 300px; text-align: center; background: #fafafa; padding: 20px; border-radius: 8px; }
.pnl-equity-label { font-size: 11px; font-weight: 600; color: var(--pt-text-muted); text-transform: uppercase; margin-bottom: 8px; }
.pnl-equity-value { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 800; color: var(--pt-green); }

/* Custom Tooltip */
#pnl-tooltip { position: absolute; background: rgba(0,0,0,0.8); color: #fff; padding: 6px 10px; border-radius: 4px; font-size: 11px; font-family: ui-sans-serif, system-ui, sans-serif; pointer-events: none; z-index: 1000; display: none; white-space: nowrap; }

/* Responsive adjustments */
@media (max-width: 700px) {
  .pnl-heatmap-day { width: 10px; height: 10px; }
  .pnl-weekdays { font-size: 8px; padding-top: 6px; }
  .pnl-stats-row { flex-direction: column; gap: 16px; border: 0; }
  .pnl-stat-item { border-left: 0; padding-left: 0; border-bottom: 1px solid var(--pt-border); padding-bottom: 16px; }
  .pnl-stat-item:last-child { border-bottom: 0; padding-bottom: 0; }
}

/* ---- Notification Toast System ---- */
.pt-toast-container {
  position: fixed; bottom: 18px; right: 18px; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 10px;
  max-height: calc(100vh - 100px); overflow: visible;
  pointer-events: none;
}
.pt-toast-container > * { pointer-events: auto; }

.pt-toast {
  width: 340px; max-width: calc(100vw - 36px);
  background: #1e2128; color: #e2e4e9;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.18);
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px; cursor: default;
  transform: translateX(120%); opacity: 0;
  animation: ptToastSlideIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
  will-change: transform, opacity;
  border-left: 3.5px solid transparent;
}
.pt-toast.pt-toast-exit {
  animation: ptToastSlideOut .28s cubic-bezier(.55,.08,.68,.53) forwards;
}

/* Status accent colours on left border */
.pt-toast[data-status="success"] { border-left-color: #22c55e; }
.pt-toast[data-status="warning"] { border-left-color: #f59e0b; }
.pt-toast[data-status="error"]   { border-left-color: #ef4444; }
.pt-toast[data-status="cancelled"] { border-left-color: #6b7280; }
.pt-toast[data-status="info"]    { border-left-color: #3b82f6; }

@keyframes ptToastSlideIn {
  0% { transform: translateX(120%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes ptToastSlideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

.pt-toast-body {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px 10px;
}
.pt-toast-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; margin-top: 1px;
}
.pt-toast[data-status="success"] .pt-toast-icon { background: rgba(34,197,94,.15); color: #22c55e; }
.pt-toast[data-status="warning"] .pt-toast-icon { background: rgba(245,158,11,.15); color: #f59e0b; }
.pt-toast[data-status="error"]   .pt-toast-icon { background: rgba(239,68,68,.15); color: #ef4444; }
.pt-toast[data-status="cancelled"] .pt-toast-icon { background: rgba(107,114,128,.15); color: #9ca3af; }
.pt-toast[data-status="info"]    .pt-toast-icon { background: rgba(59,130,246,.15); color: #3b82f6; }

.pt-toast-content { flex: 1; min-width: 0; }
.pt-toast-title {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px; color: #f1f3f5;
  margin-bottom: 3px; line-height: 1.3;
}
.pt-toast-title .pt-toast-symbol {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800; font-size: 12.5px; letter-spacing: .02em;
}
.pt-toast-title .pt-toast-op {
  font-size: 10.5px; font-weight: 700; padding: 1.5px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.pt-toast-op.op-placed, .pt-toast-op.op-executed { background: rgba(34,197,94,.18); color: #4ade80; }
.pt-toast-op.op-modified { background: rgba(245,158,11,.18); color: #fbbf24; }
.pt-toast-op.op-cancelled { background: rgba(107,114,128,.22); color: #9ca3af; }
.pt-toast-op.op-rejected, .pt-toast-op.op-failed { background: rgba(239,68,68,.18); color: #f87171; }

.pt-toast-detail {
  font-size: 12px; color: #9ca3af; line-height: 1.45;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px;
}
.pt-toast-price {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600; font-size: 12.5px; color: #d1d5db;
}
.pt-toast-change {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; font-weight: 600;
}
.pt-toast-change.up   { color: #22c55e; }
.pt-toast-change.down { color: #ef4444; }
.pt-toast-change.flat { color: #6b7280; }

.pt-toast-time {
  font-size: 10.5px; color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pt-toast-close {
  flex-shrink: 0; background: none; border: 0; color: #6b7280;
  font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1;
  border-radius: 4px; transition: color .12s, background .12s;
  margin-top: 1px;
}
.pt-toast-close:hover { color: #e2e4e9; background: rgba(255,255,255,.1); }

/* Auto-dismiss progress bar */
.pt-toast-progress {
  height: 2.5px; background: rgba(255,255,255,.08);
}
.pt-toast-progress-bar {
  height: 100%; width: 100%;
  transform-origin: left;
  animation: ptToastProgress 5s linear forwards;
}
.pt-toast.pt-toast-paused .pt-toast-progress-bar { animation-play-state: paused; }
.pt-toast[data-status="success"] .pt-toast-progress-bar { background: #22c55e; }
.pt-toast[data-status="warning"] .pt-toast-progress-bar { background: #f59e0b; }
.pt-toast[data-status="error"]   .pt-toast-progress-bar { background: #ef4444; }
.pt-toast[data-status="cancelled"] .pt-toast-progress-bar { background: #6b7280; }
.pt-toast[data-status="info"]    .pt-toast-progress-bar { background: #3b82f6; }

@keyframes ptToastProgress {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

@media (max-width: 480px) {
  .pt-toast-container { left: 10px; right: 10px; bottom: 12px; }
  .pt-toast { width: 100%; max-width: none; }
}

/* Order modal Sensibull/Kite style overrides */
.kite-header { padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; color: #fff; border-top-left-radius: 8px; border-top-right-radius: 8px; }
.kite-header.buy { background: #3b82f6 !important; } /* Blue */
.kite-header.sell { background: #f97316 !important; } /* Orange */
.kite-toggle { position: relative; display: inline-block; width: 34px; height: 18px; margin-top: 10px;}
.kite-toggle input { opacity: 0; width: 0; height: 0; }
.kite-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.2); transition: .4s; border-radius: 18px; }
.kite-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: white; transition: .2s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.3);}
.kite-toggle input:checked + .kite-slider { background-color: rgba(255,255,255,0.4); }
.kite-toggle input:checked + .kite-slider:before { transform: translateX(16px); }

.pt-modal-tabs { display: flex; border-bottom: 1px solid var(--pt-border); background: #f4f5f7; font-size: 13px; font-weight: 500; }
.pt-modal-tab { flex: 1; text-align: center; padding: 12px 10px; color: #999; cursor: pointer; }
.pt-modal-tab.active { color: #3b82f6; border-bottom: 2px solid #3b82f6; background: #fff; }
.kite-header.sell ~ .pt-modal-body .pt-modal-tab.active { color: #f97316; border-bottom: 2px solid #f97316; }

.pt-modal-grid-3 { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 12px; align-items: flex-end; padding: 0 16px; position: relative;}
.pt-form-row { display: flex; padding: 0 16px; }
.pt-mb-4 { margin-bottom: 16px; }
.pt-radio-group { display: flex; gap: 16px; align-items: center; }
.pt-radio-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--pt-text); cursor: pointer; margin: 0; }
.pt-radio-label input[type="radio"] { margin: 0; accent-color: #3b82f6; width: 14px; height: 14px; cursor: pointer; }
.kite-header.sell ~ .pt-modal-body .pt-radio-label input[type="radio"] { accent-color: #f97316; }

.pt-input.kite-input { background: #fff; margin: 0;}
.kite-disabled, .pt-input.kite-input:disabled { 
    background: repeating-linear-gradient( 45deg, #f9fafb, #f9fafb 10px, #f4f5f7 10px, #f4f5f7 20px ) !important;
    color: #444;    
    opacity: 0.85;
}

.pt-modal-footer { border-top: 1px solid var(--pt-border); background: #f9fafb; padding: 16px; }
.pt-modal-margin-row { display: flex; gap:16px; font-size: 12.5px; margin-bottom: 16px; color: var(--pt-text-muted); }
.pt-modal-actions-kite { display: flex; flex-direction: column; gap: 8px; }
.pt-submit-btn-kite { width: 100%; padding: 12px; border: 0; border-radius: 6px; font-size: 15px; font-weight: 500; color: #fff; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.pt-submit-btn-kite.buy { background: #3b82f6; }
.pt-submit-btn-kite.sell { background: #f97316; }
.pt-cancel-btn-kite { width: 100%; padding: 12px; border: 1px solid var(--pt-border); border-radius: 6px; background: #fff; font-size: 15px; font-weight:400; color: #555; cursor: pointer; }
.pt-cancel-btn-kite:hover { background: #f1f3f4; color: #111;}

/* ---- General Buttons (.pt-btn) ---- */
.pt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: all 0.15s ease-in-out; padding: 8px 16px; font-size: 13.5px; }
.pt-btn:active { transform: scale(0.98); }
.pt-btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 5px; }
.pt-btn-primary { background: var(--pt-accent); color: #fff; border-color: var(--pt-accent); box-shadow: 0 2px 4px rgba(37,99,235,0.2); }
.pt-btn-primary:hover { filter: brightness(1.1); box-shadow: 0 4px 8px rgba(37,99,235,0.3); }
.pt-btn-secondary { background: var(--pt-bg-secondary, #f1f5f9); color: var(--pt-text); border-color: var(--pt-border); }
.pt-btn-secondary:hover { background: var(--pt-border); color: #000; }
.pt-btn-ghost { background: transparent; color: var(--pt-text-muted); }
.pt-btn-ghost:hover { background: var(--pt-bg-soft); color: var(--pt-text); }

@keyframes fallParticle {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ---- Unlock Reward Celebration Widget ---- */
.pt-reward-widget {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.6) 0%, rgba(253, 230, 138, 0.4) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}
.dark .pt-reward-widget {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.7) 0%, rgba(49, 46, 129, 0.5) 100%);
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pt-reward-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pt-reward-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pt-reward-gift-svg {
  width: 22px;
  height: 22px;
  color: #d97706;
  flex-shrink: 0;
  animation: pt-bounce-soft 2s infinite ease-in-out;
}
.dark .pt-reward-gift-svg {
  color: #fbbf24;
}

@keyframes pt-bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.pt-reward-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  line-height: 1.2;
}
.dark .pt-reward-title {
  color: #fef08a;
}

.pt-reward-subtitle {
  font-size: 11px;
  color: #b45309;
  font-weight: 500;
}
.dark .pt-reward-subtitle {
  color: #a5b4fc;
}

.pt-reward-progress-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f59e0b;
  color: #fff;
  letter-spacing: 0.5px;
}

.pt-reward-progress-bar {
  height: 6px;
  background: rgba(245, 158, 11, 0.2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}
.dark .pt-reward-progress-bar {
  background: rgba(255, 255, 255, 0.1);
}

.pt-reward-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #10b981 100%);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.pt-reward-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pt-reward-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  transition: all 0.15s ease;
}
.dark .pt-reward-card {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.pt-reward-card.pt-claimed {
  background: rgba(236, 253, 245, 0.9);
  border-color: rgba(16, 185, 129, 0.3);
}
.dark .pt-reward-card.pt-claimed {
  background: rgba(6, 78, 59, 0.4);
  border-color: rgba(16, 185, 129, 0.4);
}

.pt-reward-card-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pt-reward-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fef3c7;
  color: #d97706;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dark .pt-reward-icon-box {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.pt-claimed .pt-reward-icon-box {
  background: #d1fae5;
  color: #059669;
}
.dark .pt-claimed .pt-reward-icon-box {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.pt-reward-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pt-text);
  line-height: 1.2;
}

.pt-reward-card-bonus {
  font-size: 10.5px;
  font-weight: 700;
  color: #059669;
}
.dark .pt-reward-card-bonus {
  color: #34d399;
}

.pt-reward-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  background: #f59e0b;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  transition: all 0.15s ease;
}
.pt-reward-btn:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.pt-reward-status-claimed {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
}
.dark .pt-reward-status-claimed {
  color: #34d399;
}

/* ---- Modern Reward Modal Styling ---- */
.pt-reward-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: ptModalBgFade 0.2s ease-out;
}

@keyframes ptModalBgFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pt-reward-modal-content {
  background: #ffffff;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  padding: 28px 24px 24px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(245, 158, 11, 0.25);
  animation: ptModalCardScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.dark .pt-reward-modal-content {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(245, 158, 11, 0.3);
}

@keyframes ptModalCardScale {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pt-modal-close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.12);
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pt-modal-close-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  color: #0f172a;
  transform: rotate(90deg);
}
.dark .pt-modal-close-btn { color: #94a3b8; }
.dark .pt-modal-close-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.15); }

.pt-modal-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d97706;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}
.dark .pt-modal-pill-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.3);
}

.pt-reward-modal-header {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  margin-bottom: 20px !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  cursor: default !important;
  user-select: text !important;
}

.pt-reward-modal-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #d97706 !important;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.2);
}
.dark .pt-reward-modal-icon-wrap {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.25) 100%) !important;
  color: #fbbf24 !important;
}

.pt-reward-modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--pt-text) !important;
  line-height: 1.3;
}
.pt-reward-modal-header p {
  font-size: 12.5px;
  color: var(--pt-text-muted) !important;
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.pt-modal-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.pt-input-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.pt-modal-input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--pt-border);
  border-radius: 10px;
  font-size: 13.5px;
  background: var(--pt-bg);
  color: var(--pt-text);
  box-sizing: border-box;
  outline: none;
  transition: all 0.15s ease;
}
.pt-modal-input-wrapper input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3.5px rgba(245, 158, 11, 0.2);
}

.pt-reward-error {
  font-size: 12px;
  font-weight: 500;
  color: #ef4444;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pt-btn-submit-reward {
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transition: all 0.15s ease;
}
.pt-btn-submit-reward:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}
.pt-btn-submit-reward:active {
  transform: translateY(0);
}

.pt-btn-telegram-join {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(37, 161, 224, 0.12);
  color: #0284c7;
  border: 1px solid rgba(37, 161, 224, 0.3);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.pt-btn-telegram-join:hover {
  background: rgba(37, 161, 224, 0.22);
  color: #0369a1;
  transform: translateY(-1px);
}
.dark .pt-btn-telegram-join {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
