:root {
  --ink: #0c171c;
  --panel: #13232a;
  --panel-2: #1a2e36;
  --line: #28414a;
  --text: #ece7da;
  --muted: #8fa3a6;
  --brass: #d4a64a;
  --brass-dim: #8a6d2f;
  --win: #6fc7a0;
  --loss: #e8766c;
  --radius: 14px;
  --font: "Noto Sans Bengali", "Hind Siliguri", "Nirmala UI", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--ink); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.6; -webkit-text-size-adjust: 100%;
}
.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; letter-spacing: 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 0 10px; gap: 12px; }
.brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name { font-weight: 700; font-size: 19px; }
.brand-ver { font-size: 13px; color: var(--muted); }
.sync { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.sync.ok .dot { background: var(--win); }
.sync.stale .dot { background: var(--brass); }
.sync.bad .dot { background: var(--loss); }
.sync.busy .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.banner { margin: 4px 0 12px; padding: 12px 14px; border: 1px solid var(--brass-dim); border-radius: var(--radius); background: #221d10; color: #f0dca8; font-size: 14px; }
.banner.bad { border-color: #7a3d38; background: #2a1715; color: #f3c0bb; }

.view { outline: none; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.3; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.sub { color: var(--muted); font-size: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  font: inherit; font-size: 15px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: #1b1405; font-weight: 700; }

/* ড্যাশবোর্ডের মূল অংশ: মোট ফল ও R-কার্ভ */
.hero { margin-top: 8px; padding: 18px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; }
.hero-label { color: var(--muted); font-size: 14px; }
.hero-num { font-size: 56px; font-weight: 700; line-height: 1.1; margin: 2px 0 6px; }
.hero-num small { font-size: 24px; font-weight: 500; margin-left: 4px; color: var(--muted); }
.pos { color: var(--win); } .neg { color: var(--loss); } .zero { color: var(--text); }
.curve { display: block; width: 100%; height: auto; margin-top: 6px; }
.curve-empty { padding: 28px 8px 20px; color: var(--muted); font-size: 14px; }
.tape-note { color: var(--muted); font-size: 12px; margin-top: 2px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card .k { color: var(--muted); font-size: 13px; }
.card .v { font-size: 26px; font-weight: 700; line-height: 1.25; }
.note { margin-top: 12px; padding: 10px 14px; border-left: 3px solid var(--brass); background: var(--panel); border-radius: 0 10px 10px 0; font-size: 14px; color: #d9d2bd; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: right; font-weight: 500; color: var(--muted); font-size: 13px; padding: 6px 4px; }
td { text-align: right; padding: 12px 4px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
.tbl { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px 6px; }

/* সিগন্যাল কার্ড */
.sig { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.sig-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sig-pair { font-size: 20px; font-weight: 700; }
.tag { font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.buy { color: var(--win); border-color: #2f6650; }
.tag.sell { color: var(--loss); border-color: #7a3d38; }
.tag.new { background: var(--brass); color: #1b1405; border-color: var(--brass); font-weight: 700; }
.tag.conf { color: var(--brass); border-color: var(--brass-dim); }
.sig-meta { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* দামের মই: SL ← এন্ট্রি → TP। এক নজরে ঝুঁকি ও লক্ষ্য */
.rail { position: relative; height: 66px; margin: 18px 34px 6px; }
.rail-line { position: absolute; left: 0; right: 0; top: 22px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--loss) 0 var(--p-entry), var(--win) var(--p-entry) 100%); opacity: .9; }
.rail-line.rev { background: linear-gradient(90deg, var(--win) 0 var(--p-entry), var(--loss) var(--p-entry) 100%); }
.mark { position: absolute; top: 0; transform: translateX(-50%); text-align: center; font-size: 13px; line-height: 1.3; white-space: nowrap; }
.mark b { display: block; font-size: 14px; font-weight: 600; }
.mark i { display: block; width: 2px; height: 14px; margin: 0 auto; background: currentColor; }
.mark.sl { color: var(--loss); } .mark.tp { color: var(--win); } .mark.en { color: var(--brass); }
.mark .lab { display: block; margin-top: 18px; }
.mark.en i { height: 14px; width: 12px; background: var(--brass); transform: rotate(45deg) scale(.6); border-radius: 2px; margin-top: 2px; }
.sig-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }

/* তালিকা */
.rows { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 64px; color: inherit; text-decoration: none;
  border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
a.row:active { background: var(--panel-2); }
.row .l { min-width: 0; } .row .r { text-align: right; flex: none; }
.row .t { font-weight: 600; } .row .s { color: var(--muted); font-size: 13px; }
.arrow { display: inline-block; width: 22px; text-align: center; font-weight: 700; }
.run-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-left: 6px; }
details.hrow { border-top: 1px solid var(--line); }
details.hrow:first-child { border-top: 0; }
details.hrow summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; min-height: 64px; }
details.hrow summary::-webkit-details-marker { display: none; }
.detail { padding: 0 16px 14px; color: var(--muted); font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; }
.detail dt { color: var(--muted); } .detail dd { margin: 0; color: var(--text); }

.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--brass);
  background: transparent; color: var(--brass); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; margin-top: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; }

/* নিচের মেনু */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 560px; margin: 0 auto;
  background: rgba(19, 35, 42, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; color: var(--muted);
  text-decoration: none; font-size: 12px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--brass); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--brass); border-radius: 0 0 3px 3px; }
.count { position: absolute; top: 8px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brass); color: #1b1405;
  font-style: normal; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
