/* EW Dalga-3 Tarayıcı — koyu tema, mobil uyumlu.
   LONG/SHORT çifti (#26a69a / #ef5350) her yerde ▲/▼ ve metinle birlikte kullanılır. */
:root {
  color-scheme: dark;
  --bg: #0b0f16;
  --surface: #121822;
  --surface-2: #171f2b;
  --surface-3: #1e2835;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --grid: #1c2430;
  --text: #e8ebf1;
  --text-2: #b6bfcc;
  --muted: #8f99aa;
  --accent: #3987e5;
  --accent-hover: #5299ec;
  --long: #26a69a;
  --short: #ef5350;
  --long-tint: rgba(38, 166, 154, 0.16);
  --short-tint: rgba(239, 83, 80, 0.16);
  --good: #3fb950;
  --warn: #fab219;
  --bad: #f05a5a;
  --target: #7cc4a8;
  --wave: #f0c75e;
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  min-height: 100vh;
}
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

button, select, input { font: inherit; color: inherit; }
button {
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
}
button:hover { background: var(--surface-3); }
button:disabled { opacity: 0.55; cursor: progress; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-hover); }
button.ghost { background: transparent; }
select, input[type='number'], input[type='text'] {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  min-width: 0;
}
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.top, .toolbar, .settings, .summary, .layout, .foot {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 12px;
}
.top h1 { font-size: 22px; }
.sub { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.link { white-space: nowrap; font-size: 13px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 7px 14px; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button[aria-pressed='true'] { background: var(--accent); color: #fff; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.field small { color: var(--muted); font-size: 11px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }

.progress { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 200px; font-size: 13px; color: var(--text-2); }
.progress[hidden] { display: none; }
.progress .bar { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }

.settings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 6px;
  margin-bottom: 6px;
}
.settings[hidden] { display: none; }
.settings .row2 { display: flex; gap: 6px; }
.settings .row2 > * { flex: 1; }
.settings .actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }

.summary { padding-top: 8px; padding-bottom: 8px; font-size: 13px; }
.summary p { margin: 0; }
.summary .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
.error { color: var(--bad); }

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 24px;
  align-items: start;
}
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h2 { font-size: 16px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.cards .empty { padding: 24px 12px; text-align: center; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border-strong); }

.card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.card:hover { background: var(--surface-2); }
.card.long { border-left-color: var(--long); }
.card.short { border-left-color: var(--short); }
.card[aria-current='true'] { border-color: var(--accent); border-left-width: 4px; background: var(--surface-2); }
.card.faded { opacity: 0.6; }
.card .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card .coin { font-weight: 700; font-size: 16px; }
.card .score { margin-left: auto; font-size: 12px; color: var(--text-2); }
.card .meta { margin-top: 6px; font-size: 12px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.card .lv { margin-top: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; font-size: 12px; }
.card .lv div { background: var(--surface-3); border-radius: 6px; padding: 4px 6px; min-width: 0; }
.card .lv b { display: block; font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card .lv span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dir { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.03em; }
.dir.long { color: var(--long); background: var(--long-tint); }
.dir.short { color: var(--short); background: var(--short-tint); }
.state { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.state.triggered { color: #fff; background: var(--accent); }
.state.ready { color: var(--warn); background: rgba(250, 178, 25, 0.14); }
.state.invalid { color: var(--bad); }

.detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
.detail .empty { padding: 60px 12px; text-align: center; }
.detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-head h2 { font-size: 18px; }
.detail-head .ext { margin-left: auto; font-size: 13px; }
.chart { height: 440px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin: 8px 0 4px; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 4px; }
.legend i.dash { border-top-style: dashed; }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.facts div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 10px; }
.facts b { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.facts span { font-size: 14px; }

.rules h3 { font-size: 14px; margin: 16px 0 6px; }
.rules ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rules li { display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; }
.rules li .ic { font-weight: 700; text-align: center; }
.rules li.pass .ic { color: var(--good); }
.rules li.warn .ic { color: var(--warn); }
.rules li.fail .ic { color: var(--bad); }
.rules li.info .ic, .rules li.na .ic { color: var(--muted); }
.rules li .nm { font-weight: 600; }
.rules li .dt { color: var(--text-2); }
.rules li .src { color: var(--muted); font-size: 11px; }

.foot { padding-top: 12px; padding-bottom: 28px; font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .chart { height: 360px; }
}
@media (max-width: 520px) {
  .top { flex-direction: column; align-items: flex-start; }
  .card .lv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart { height: 320px; }
  .toolbar > .primary { flex: 1; }
}

/* Giriş planları (B kırılımı / limit bölge) */
.plan { margin-top: 8px; padding: 8px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); }
.plan.faded { opacity: 0.55; }
.plan.muted-plan { font-size: 12px; }
.plan-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.plan-name { font-weight: 600; color: var(--text); }
.plan-head .rr { margin-left: auto; color: var(--text-2); }
.plan .lv { margin-top: 6px; }
.note { margin: 6px 0 0; font-size: 12px; color: var(--warn); }
.state.zone-waiting { color: var(--warn); background: rgba(250, 178, 25, 0.14); }
.state.zone-filled { color: #fff; background: #c9771f; }
.state.zone-stopped, .state.zone-passed { color: var(--bad); }
.state.zone-target { color: var(--good); }
.chip.str-Güçlü { color: var(--good); }
.chip.str-Orta { color: var(--warn); }
.chip.str-Zayıf { color: var(--muted); }
h3.sec { font-size: 14px; margin: 16px 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.levels { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.levels li { display: grid; grid-template-columns: 1fr auto 90px; gap: 8px; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.levels li.in { color: var(--text-2); }
.levels li.edge { color: #ff9f43; font-weight: 600; }
.card .lv div.wide { grid-column: span 2; }

/* Gezinme + backtest sayfası */
.nav { display: flex; gap: 16px; align-items: center; font-size: 13px; white-space: nowrap; }
.nav a:first-child { font-weight: 600; }
.small { font-size: 12px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
button.sm { padding: 3px 9px; font-size: 12px; }
input[type='date'] { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 5px 8px; color-scheme: dark; }
.bt-form, .bt-results, .runs-box {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.bt-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; align-items: end; padding-top: 8px; padding-bottom: 8px; }
.bt-form .seg { align-self: end; justify-self: start; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.bt-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.estimate { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.bt-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }
.bt-title h2 { font-size: 17px; }
.spacer { flex: 1; }
.filebtn { cursor: pointer; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 14px; font-size: 14px; }
.tile-group { margin-bottom: 10px; }
.tile-group h3 { font-size: 14px; margin: 6px 0; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.tile b { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.tile span { font-size: 18px; font-weight: 600; }
.chart.eq { height: 300px; margin-top: 12px; border: 1px solid var(--border); }
.breakdowns { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 12px; }
.bd { min-width: 0; overflow-x: auto; }
.bd h3 { font-size: 13px; margin: 0 0 4px; color: var(--text-2); }
.table-wrap { overflow-x: auto; }
table.stat, table.trades, table.runs { width: 100%; border-collapse: collapse; font-size: 12px; }
table.stat th, table.stat td, table.trades th, table.trades td, table.runs th, table.runs td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.stat td.num, table.trades td.num, table.runs td.num { text-align: right; }
table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
table.runs tr.sel { background: var(--surface-2); }
table.runs td.acts { white-space: nowrap; display: flex; gap: 4px; }
.trades-box { margin-top: 14px; }
.trades-box summary { cursor: pointer; color: var(--text-2); }
.runs-box { padding-bottom: 10px; }
@media (max-width: 520px) {
  .breakdowns { grid-template-columns: minmax(0, 1fr); }
  .tile span { font-size: 16px; }
}
.layout.stale { opacity: 0.4; pointer-events: none; transition: opacity 0.2s; }

/* Mükemmel çakışma */
.chip.str-Mükemmel { color: #1a1300; background: #f0c75e; font-weight: 700; }
.state.zone-approaching { color: #1a1300; background: #ffcf5c; font-weight: 600; }
.perfect-toggle { color: #f0c75e; font-weight: 600; }
.warn-txt { color: var(--warn); }

/* Mod: üçgen kırılımı */
body.mode-triangle .wave-only { display: none; }
.state.tri-broken { color: #fff; background: var(--accent); }
.state.tri-near { color: #1a1300; background: #ffcf5c; font-weight: 600; }
.state.tri-forming { color: var(--warn); background: rgba(250, 178, 25, 0.14); }
.state.tri-failed { color: var(--bad); }
.reach { margin-top: 14px; overflow-x: auto; }
.reach table th[colspan] { text-align: center; color: var(--text-2); }

/* Masaüstünde sağ panel sabit: liste sayfayla kayar, grafik yerinde kalır; ayrıntının altı kendi içinde kayar */
@media (min-width: 901px) {
  .detail { position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
}

/* Sekmeler + takip listesi */
.tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--border-strong); }
.tabs button { border: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: transparent; padding: 8px 14px; color: var(--text-2); }
.tabs button[aria-selected='true'] { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.tabs .count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-3); font-size: 11px; }
body.view-watch .setups-only, body:not(.view-watch) .watch-only { display: none; }
.star { cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); padding: 0 2px; }
.star:hover, .star.on { color: #f0c75e; }
.card .head .star { margin-left: 4px; }
.watch-card { cursor: pointer; }
.watch-card .rm { min-width: 28px; min-height: 28px; padding: 0 6px; margin: -4px -6px -4px 0; border: 0; background: transparent; color: var(--muted); font-size: 14px; line-height: 1; border-radius: var(--radius-sm); cursor: pointer; }
.watch-card .rm:hover, .watch-card .rm:focus-visible { color: var(--bad); background: rgba(240, 90, 90, 0.12); }
button:disabled { opacity: 0.45; cursor: default; }
.state.w-waiting { color: var(--warn); background: rgba(250, 178, 25, 0.14); }
.state.w-entered { color: #fff; background: var(--accent); }
.state.w-done { color: #0b0f16; background: var(--good); font-weight: 600; }
.state.w-stopped, .state.w-invalid { color: var(--bad); }
.state.w-missed, .state.w-expired { color: var(--muted); }
.note-txt { margin-top: 6px; font-size: 12px; color: var(--text-2); }
.watch-note { width: 100%; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px; resize: vertical; }
.watch-actions { display: flex; gap: 8px; margin: 8px 0; }
button.danger { color: var(--bad); border-color: rgba(240, 90, 90, 0.4); }
.list-head select { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 4px 6px; }
.filebtn.sm { padding: 3px 9px; font-size: 12px; }

/* ABCDE üçgen modu */
body.mode-abcde .wave-only { display: none; }
.state.ab-waiting { color: var(--warn); background: rgba(250, 178, 25, 0.14); }
.state.ab-approaching { color: #1a1300; background: #ffcf5c; font-weight: 600; }
.state.ab-filled { color: #fff; background: #c9771f; }
.state.ab-ready { color: #fff; background: var(--accent); }
.state.ab-stopped { color: var(--bad); }
.state.ab-target { color: var(--good); }
.state.ab-missed, .state.ab-old { color: var(--muted); }
.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rule-list li { padding: 6px 8px; background: var(--surface-2); border-radius: var(--radius-sm); }
.rule-list .ok { color: var(--good); font-weight: 700; }
.rule-list .bad { color: var(--bad); font-weight: 700; }
