:root {
  --bg: #0a0b16; --bg-2: #0f1124; --panel: #13152c; --panel-2: #1a1d3b; --line: #252a52; --line-2: #343a6e;
  --text: #eef0fb; --text-2: #b4b9d8; --text-3: #7f86ab;
  --accent: #8b5cf6; --accent-2: #a855f7; --accent-soft: rgba(139, 92, 246, .16);
  --good: #22c55e; --good-ink: #86efac; --good-soft: rgba(34, 197, 94, .14);
  --bad: #ef4444; --bad-ink: #fca5a5; --bad-soft: rgba(239, 68, 68, .14);
  --warn-ink: #fcd34d; --warn-soft: rgba(245, 158, 11, .14);
  --radius: 14px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100vh; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 6px; }
h3.sec { margin: 24px 0 12px; color: var(--text-2); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
a { color: #c9b8ff; }
.muted { color: var(--text-2); } .small { font-size: 13px; }
.ok { color: var(--good-ink); } .badc { color: var(--bad-ink); } .warnc { color: var(--warn-ink); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------- gate (invite / sign-in) */
.gate-top { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.gate { padding: 24px 16px 48px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 8px; }
.brand b { display: block; font-size: 17px; line-height: 1.1; }
.brand small { color: var(--text-3); font-size: 12px; }

/* ---------------- shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; }   /* the phone menu scrolls sideways instead of widening the page */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; background: var(--bg-2); border-right: 1px solid var(--line); }
.side .brand { padding: 0 6px; }
.nav { display: grid; gap: 4px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dotbadge { position: absolute; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.plancard { margin-top: auto; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 8px; }
.plancard p { margin: 0; }
.plan-top { display: flex; align-items: center; gap: 8px; }
.crown { color: #fbbf24; }
.main { min-width: 0; padding: 0 24px 40px; }
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title pills user"; align-items: center; gap: 12px 14px; padding: 20px 0 18px; }
.topbar p { margin: 4px 0 0; }
.topbar .title { grid-area: title; min-width: 0; }
.topbar .pills { grid-area: pills; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.topbar .user { grid-area: user; }
.mbrand { display: none; grid-area: brand; align-items: center; gap: 10px; min-width: 0; }
.mbrand img { border-radius: 8px; flex: none; }
.mbrand b { font-size: 17px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.pill.small { padding: 4px 10px; font-size: 12px; }
.pill.good { border-color: rgba(34, 197, 94, .5); background: var(--good-soft); color: var(--good-ink); } .pill.good i { background: var(--good); }
.pill.warn { border-color: rgba(245, 158, 11, .5); background: var(--warn-soft); color: var(--warn-ink); } .pill.warn i { background: #f59e0b; }
.pill.bad { border-color: rgba(239, 68, 68, .5); background: var(--bad-soft); color: var(--bad-ink); } .pill.bad i { background: var(--bad); }
.pill.quiet { color: var(--text-2); }
.user { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.user-btn:hover { border-color: var(--accent); }
.user-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the avatar: a plain round badge with the initials (no gradient), easy to read on the dark top bar */
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: .03em; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.avatar.big { width: 40px; height: 40px; font-size: 15px; }
.uname { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 16px; height: 16px; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 250px; max-width: calc(100vw - 32px); padding: 8px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); display: grid; gap: 2px; }
.menu[hidden] { display: none; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.menu-head div { min-width: 0; }
.menu-head b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-head p { margin: 2px 0 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px; border-radius: 9px; border: 0; background: none; color: var(--text); font: 600 14px/1.2 inherit; text-decoration: none; cursor: pointer; }
.menu a svg, .menu button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--text-2); }
.menu a:hover, .menu button:hover { background: var(--panel); }
.menu .danger-item { color: var(--bad-ink); } .menu .danger-item svg { color: var(--bad-ink); }

/* ---------------- cards, tiles */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.narrow { max-width: 440px; margin: 24px auto; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head.pad { padding: 16px 18px 0; }
.stack { display: grid; gap: 16px; align-content: start; }
.tiles6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.tile > div { display: grid; gap: 2px; min-width: 0; }
.tile small { color: var(--text-3); font-size: 12px; }
.tile b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile em { font-style: normal; font-size: 12px; color: var(--text-2); }
.ic { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: #c4b5fd; }
.ic.good { background: var(--good-soft); color: var(--good-ink); }
.ic.bad { background: var(--bad-soft); color: var(--bad-ink); }
.grid-a { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
/* the open trade, full width; performance (reports page), four figures per row */
.pos-card .table td, .pos-card .table th { padding: 11px 12px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.stat { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); min-width: 0; }
.stat small { color: var(--text-2); font-size: 12px; }
.stat b { font-size: 18px; font-weight: 600; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.live-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.live-state.on i { background: var(--good); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livepulse 1.6s infinite; }
.live-state.on { color: var(--good-ink); }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .live-state.on i { animation: none; } }
.tick { transition: background-color .6s; } .tick.up { background: rgba(34, 197, 94, .14); } .tick.dn { background: rgba(239, 68, 68, .14); }
/* the status strip at the top of the dashboard */
.statusbar { padding: 14px 18px; margin-bottom: 16px; }
.status.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 18px; }
.status.strip li { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 6px; }
.status.strip li > span:first-child { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.status.strip li { min-width: 0; }
.status.strip .pill { white-space: normal; max-width: 100%; line-height: 1.3; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin-top: 12px; }
.bar span { display: block; height: 100%; width: 0; background: var(--good); border-radius: 999px; transition: width .3s; }
.foot { margin-top: 16px; }
.status { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.status li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; font-size: 14px; }
.status li span:first-child { display: flex; align-items: center; gap: 10px; }

/* ---------------- charts */
.chart { position: relative; width: 100%; overflow: hidden; }
.chart svg { display: block; overflow: visible; stroke: none; stroke-width: 1; fill: none; max-width: 100%; }
.chart svg text { stroke: none; }
.grid-a > .card:first-child { display: flex; flex-direction: column; }
#curve { flex: 1; min-height: 240px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .zero { stroke: var(--line-2); stroke-width: 1; }
.chart .empty { fill: var(--text-3); font-size: 13px; }
.tip { position: fixed; z-index: 50; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: #050611; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .5); white-space: nowrap; }
.tip b { display: block; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ---------------- tables */
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table thead th { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table td.empty { color: var(--text-2); white-space: normal; }
.side-b { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.side-b.buy { background: var(--good-soft); color: var(--good-ink); }
.side-b.sell { background: var(--bad-soft); color: var(--bad-ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.pager:empty { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sumrow { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 14px; font-size: 14px; }
.sumrow b { font-variant-numeric: tabular-nums; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { font: 600 13px/1 inherit; color: var(--text-2); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 14px; cursor: pointer; }
.chips button.on { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------------- forms, buttons */
form { display: grid; gap: 14px; }
.grid2 { grid-template-columns: 1fr 1fr; gap: 14px 18px; align-items: end; }
.span2 { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
label .muted { font-weight: 400; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* file picker: the theme's button instead of the browser's grey one */
input[type="file"] { padding: 6px; color: var(--text-2); font-size: 13.5px; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font: 600 13.5px/1.2 inherit; cursor: pointer; }
input[type="file"]:hover::file-selector-button { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14.5px/1 inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 16px; cursor: pointer; min-height: 42px; text-decoration: none; }
.btn.small { padding: 8px 13px; min-height: 36px; font-size: 13.5px; }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.btn.danger { background: var(--bad-soft); border-color: rgba(239, 68, 68, .45); color: var(--bad-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.wide { width: 100%; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.error { color: var(--bad-ink); min-height: 0; margin: 0; }
.error:empty { display: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; } .row.end { justify-content: flex-end; }
.row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.row-head p { margin: 0; }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; background: var(--bg-2); }
.step p { margin: 0; }
.key { display: block; font-size: 15px; letter-spacing: .08em; word-break: break-all; padding: 10px; border-radius: 8px; background: var(--panel-2); user-select: all; }
dialog { color: var(--text); padding: 22px; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog h2 { margin-bottom: 10px; }

/* ---------------- plans + plan builder */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tier { position: relative; display: grid; gap: 6px; align-content: start; }
.tier.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.tier.mine { border-color: rgba(34, 197, 94, .55); }
.tier.picked { background: var(--panel-2); }
.tier h3 { margin: 0; font-size: 17px; }
.tier .price { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tier .price small { font-size: 13px; font-weight: 500; color: var(--text-2); }
.tier ul { margin: 4px 0 8px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; display: grid; gap: 3px; }
.tier .btn { justify-self: start; }
.tier .tag { position: absolute; top: 14px; right: 14px; }
.builder form { gap: 16px; }
.pb-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pb-pick { display: grid; gap: 16px; }
.stepper { display: flex; gap: 8px; align-items: center; }
.stepper input { width: 110px; text-align: center; font-size: 18px; font-weight: 700; }
.stepper .btn { width: 44px; height: 44px; padding: 0; font-size: 20px; }
.seg { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.seg label { display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); height: 100%; }
.seg small { color: var(--text-2); font-weight: 400; font-size: 12.5px; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.pb-price { padding: 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.pb-price .kv { font-size: 14px; }
.pb-total { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 600; }
.pb-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.req { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.req p { margin: 0; flex: 1 1 320px; }
.req.pending { border-color: #92400e; background: rgba(245, 158, 11, .07); }
.req.approved { border-color: #166534; background: rgba(34, 197, 94, .07); }
.req.rejected { border-color: #7f1d1d; }

/* ---------------- plan, keys, support */
.plan-now { display: grid; grid-template-columns: 1fr minmax(0, 360px); gap: 20px; align-items: center; }
.plan-now h2 { font-size: 22px; margin: 2px 0 4px; }
.plan-now p { margin: 0; }
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 12px; }
.offer { display: grid; gap: 8px; align-content: start; }
.offer p { margin: 0 0 6px; }
.offer .btn { justify-self: start; }
#keys-cloud, #p-settings, #p-plan, #p-reports { display: grid; gap: 16px; }
#p-plan { display: block; }
#p-plan > .card, #p-reports > .card { margin-bottom: 16px; }
.ipline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ip { font-size: 18px; padding: 4px 10px; border-radius: 8px; background: var(--panel-2); user-select: all; }
.steps { padding-left: 20px; display: grid; gap: 4px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { color: var(--text); }
/* an on/off switch (Auto trade) */
.switch { position: relative; width: 46px; height: 26px; padding: 0; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer; vertical-align: middle; }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); transition: transform .15s ease, background .15s ease; }
.switch[aria-checked="true"] { background: var(--good-soft); border-color: rgba(34, 197, 94, .55); }
.switch[aria-checked="true"] span { transform: translateX(20px); background: var(--good); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:disabled { opacity: .45; cursor: default; }
@media (prefers-reduced-motion: reduce) { .switch span { transition: none; } }
.auto-note { margin: 10px 0 0; }
.bk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; margin-top: 8px; }
.bk-col { display: grid; gap: 12px; align-content: start; }
.bk-col h3 { font-size: 15px; }
.bk-preview { background: var(--panel-2); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.bk-preview ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 860px) { .bk-grid { grid-template-columns: minmax(0, 1fr); } }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
.subform { display: grid; gap: 10px; margin: 4px 0 12px; }
.subform[hidden], #forgot-done:empty { display: none; }

/* the 6-digit code: a pop-up with one box per digit (sign-in, reset, saving 5paisa details, password change) */
dialog.otp-dialog { width: min(420px, calc(100vw - 32px)); }
dialog.card.narrow { margin: auto; }   /* pop-ups sit in the middle of the screen */
.otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0 8px; }
.otp-boxes input { height: 56px; padding: 0; text-align: center; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums;
  border-radius: 10px; caret-color: var(--accent); }
.otp-boxes input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-boxes input.filled { border-color: var(--line-2); }
@media (max-width: 400px) { .otp-boxes { gap: 6px; } .otp-boxes input { height: 48px; font-size: 20px; } }
.ip-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.ticket { border-bottom: 1px solid var(--line); }
.ticket:last-child { border-bottom: 0; }
.ticket > button { all: unset; box-sizing: border-box; width: 100%; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 14px 16px; cursor: pointer; }
.ticket > button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ticket .subj { font-weight: 600; flex: 1 1 200px; }
.thread { padding: 0 16px 16px; display: grid; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg-2); white-space: pre-wrap; word-break: break-word; }
.msg.admin { border-color: #5b63b8; }
.msg.event { background: transparent; border-style: dashed; color: var(--text-2); font-size: 13px; }
.msg small { display: block; color: var(--text-3); margin-bottom: 4px; white-space: normal; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.badge.ok { border-color: #166534; color: var(--good-ink); } .badge.warn { border-color: #92400e; color: var(--warn-ink); }
.empty { padding: 18px 16px; color: var(--text-2); }

/* ---------------- responsive */
@media (max-width: 1180px) { .table th, .table td { padding: 10px 10px; } #rep-table .w2 { display: none; } }
@media (max-width: 1280px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1280px) {
  .tiles6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .grid-a { grid-template-columns: minmax(0, 1fr); }
  .offers { grid-template-columns: 1fr; }
  .plan-now { grid-template-columns: 1fr; }
}
/* phones / small tablets: the sidebar becomes a drawer behind the ☰ button */
.menu-btn, .drawer-close { display: none; }
.backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, .55); }
body.noscroll { overflow: hidden; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* the drawer comes in from the right, next to its button in the top right corner */
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; right: 0; left: auto; width: min(290px, 84vw); height: 100%; overflow-y: auto;
    border-right: 0; border-left: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(0, 0, 0, .6); transform: translateX(105%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s; }
  .side.open { transform: none; visibility: visible; transition: transform .25s ease; }
  .drawer-close { display: grid; place-items: center; position: absolute; top: 14px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--panel); color: var(--text); cursor: pointer; }
  .menu-btn { grid-area: menu; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--text); cursor: pointer; }
  /* phones: logo | avatar | menu on the first row; then the page title; then the status pills */
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "brand user menu" "title title title" "pills pills pills"; gap: 14px 10px; padding: 14px 0 16px; }
  .mbrand { display: flex; }
  .topbar .title { padding-top: 4px; }
  .user-btn { padding: 0; border: 0; background: none; border-radius: 50%; }
  .user-btn .uname, .user-btn .chev { display: none; }
  .user-btn .avatar { width: 42px; height: 42px; font-size: 14px; }
  .user-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px rgba(255, 255, 255, .18); }
  .main { padding: 0 16px 32px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .side, .side.open { transition: none; } }
@media (max-width: 640px) {
  /* the open trade as a labelled card: every field visible, running P&L first */
  #pos-table thead { display: none; }
  #pos-table, #pos-table tbody { display: block; }
  #pos-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 14px 16px; }
  #pos-table td { display: grid; gap: 2px; padding: 0; border: 0; text-align: left; white-space: normal; }
  #pos-table td::before { content: attr(data-label); color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 400; }
  #pos-table td.run { order: -1; grid-column: 1 / -1; font-size: 22px; }
  #pos-table td > .side-b { justify-self: start; }
  #pos-table td.empty { grid-column: 1 / -1; } #pos-table td.empty::before { content: none; }
  .status.strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px 12px; } .stat b { font-size: 16px; }
  .tiles6 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px; gap: 8px; } .tile .ic { display: none; } .tile b { font-size: 18px; }
  .grid2 { grid-template-columns: 1fr; }
  .plans, .pb-grid, .seg { grid-template-columns: 1fr; }
  .table .w { display: none; }
  .uname { display: none; }
  h1 { font-size: 21px; }
}
