:root {
  --bg: #0b0f17; --panel: #131a26; --panel2: #1b2433; --line: #253044;
  --text: #eef2f7; --muted: #8f9bb0; --accent: #f5b82e; --accent-ink: #1a1405;
  --up: #22c55e; --down: #ef4444; --blue: #38bdf8;
  --radius: 14px; --gap: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "DejaVu Sans", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.45; }
a { color: var(--blue); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { margin: 0; font-size: 22px; }

/* ---------- üst çubuk ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(11, 15, 23, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--accent); }
.brand span { color: var(--text); }
.mode-badge { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: #3b2a06; color: var(--accent); border: 1px solid #6b4d0b; }
.tabs { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.tab { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--panel); }
.tab.active { color: var(--accent-ink); background: var(--accent); }

main { max-width: 1400px; margin: 0 auto; padding: 18px 20px 80px; }
.view { display: none; }
.view.active { display: block; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: var(--gap); }

/* ---------- butonlar ve girdiler ---------- */
button, .btn, .btn-primary { font: inherit; }
.btn, .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3a4862; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled, .btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-xl { font-size: 20px; padding: 18px 34px; border-radius: 14px; width: 100%; max-width: 440px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=number] { width: 7em; }
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
textarea { width: 100%; resize: vertical; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 10px 0; }

/* ---------- tara ---------- */
.scan-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.scan-opts { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.progress { width: 100%; max-width: 640px; }
.bar { height: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffd56b); transition: width .3s; }
.progress-text { margin-top: 6px; color: var(--muted); font-size: 13px; }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: var(--gap); align-items: start; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.results-head h2 { margin: 0; }
.count { color: var(--muted); font-weight: 500; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 99px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.on { background: #24324a; color: var(--text); border-color: #3a4f75; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel2); }
tbody tr.sel { background: #22304a; box-shadow: inset 3px 0 0 var(--accent); }
td.sigs { white-space: normal; min-width: 170px; }
tr.empty td { text-align: center; color: var(--muted); padding: 30px; cursor: default; white-space: normal; }
.sym { font-weight: 800; font-size: 16px; }
.nm { color: var(--muted); font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; display: block; }
.up { color: var(--up); } .down { color: var(--down); }
.badge { display: inline-block; background: #24324a; color: #dbe4f0; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 600; margin: 1px 3px 1px 0; }
.score { display: inline-block; min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 8px; font-weight: 800; background: var(--panel2); }
.score.hi { background: #12391f; color: var(--up); } .score.mid { background: #3b2a06; color: var(--accent); }
.pack { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.pack input { width: 4.5em; }

.preview { position: sticky; top: 76px; }
.preview-empty { color: var(--muted); text-align: center; padding: 50px 10px; }
.preview-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.img-wrap { position: relative; background: var(--bg); border-radius: 10px; overflow: hidden; min-height: 200px; display: grid; place-items: center; }
.img-wrap img { width: 100%; display: block; }
.spinner { position: absolute; width: 36px; height: 36px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: none; }
.spinner.on { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.notes { padding-left: 18px; color: var(--muted); font-size: 13px; }

/* ---------- ayarlar ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.grid .wide { grid-column: span 2; }
.strategies { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.strat { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.strat.off { opacity: .55; }
.strat-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.strat-head b { font-size: 15px; }
.strat p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.kind { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.param { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--muted); }
.param input[type=range] { grid-column: 1 / -1; width: 100%; }
.param output { color: var(--text); font-weight: 700; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--up); }
.switch input:checked + span::after { transform: translateX(20px); }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.holidays { margin-top: 16px; }
.holidays summary, details summary { cursor: pointer; font-weight: 600; }
.hol-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.hol-add input[type=text] { flex: 1; min-width: 200px; }
.hol-table td { padding: 6px 8px; }
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text); font-weight: 400; }

/* ---------- evren ---------- */
.big-stat { font-size: 40px; margin: 6px 0 12px; }
.uni-list { columns: 4 180px; font-size: 13px; color: var(--muted); margin-top: 10px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); background: var(--panel2); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: var(--down); color: #fecaca; }

/* ---------- mobil ---------- */
@media (max-width: 980px) {
  .scan-layout { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; }
}
@media (max-width: 640px) {
  main { padding: 12px 10px 80px; }
  .topbar { padding: 8px 10px; }
  .tabs { margin-left: 0; width: 100%; }
  .tab { flex: 1; }
  .card { padding: 14px; }
  .grid .wide { grid-column: auto; }
  th, td { padding: 9px 5px; }
  .nm { max-width: 120px; }
  .btn-xl { max-width: none; }
}
/* ayarlar: alt başlık + anahtar satırı */
h3.sub { font-size: 14px; margin: 16px 0 8px; color: var(--muted, #9aa4b2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.switch-row { display: flex; align-items: center; gap: 10px; grid-column: 1 / -1; }
span.switch { display: inline-block; }

/* ================= Paket C: paylaşım akışı, erişilebilirlik, mobil ================= */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .btn-primary:focus-visible, .tab:focus-visible, .chip:focus-visible, .cap-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
kbd { font: 600 11px/1 ui-monospace, Consolas, monospace; background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; color: var(--text); }
.kbd-hint { margin: 0; }
.linklike { background: none; border: 0; color: var(--blue); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.banner { padding: 9px 20px; font-size: 14px; text-align: center; }
.banner.warn { background: #3b2a06; color: #fde7b0; border-bottom: 1px solid #6b4d0b; }
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.hero-buttons .btn-xl { flex: 1 1 260px; max-width: 360px; }
.btn.daily { border-color: var(--accent); color: var(--accent); }
.data-banner { font-size: 13px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; }
.data-banner b { color: var(--text); }
.data-banner.warn { border-color: #6b4d0b; color: #fde7b0; background: #2a1f06; }
.diff-line { margin: -4px 0 10px; }
th.cb, td.cb { width: 34px; padding-right: 0; }
.tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em; border-radius: 5px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.tag.new { background: #0c3a5c; color: #7dd3fc; }
.tag.lim { background: #4a1414; color: #fca5a5; }
.tag.lab { background: var(--accent); color: var(--accent-ink); margin: 0 8px 0 0; vertical-align: 1px; }
tbody tr.gated .sym, tbody tr.gated td.num { opacity: .62; }
.gate-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 5px; border-radius: 50%; background: #3b2a06; color: var(--accent); font-size: 12px; font-weight: 800; vertical-align: 1px; }
.pct-m { display: none; font-size: 12px; }
.more { width: 100%; margin-top: 10px; }
.pack + .pack { margin-top: 8px; }
.preview-title { align-items: center; }
.preview-title .pv-t { display: flex; align-items: baseline; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.preview-title .nav { font-size: 20px; line-height: 1; padding: 4px 11px; }
.sheet-close { display: none; }
.gate-box { background: #2a1f06; border: 1px solid #6b4d0b; color: #fde7b0; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.reason { font-size: 16px; font-weight: 700; margin: 0 0 10px; line-height: 1.35; }
.score-break { margin-bottom: 10px; }
.sb-head b { font-size: 22px; margin-right: 4px; }
.sb-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); margin: 6px 0; }
.sb-bar span { display: block; height: 100%; }
.sb-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.sb-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.sb-leg b { color: var(--text); }
.img-msg { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; }
.cap-tabs { display: flex; gap: 4px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.cap-tab { background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cap-tab.active { background: var(--panel2); color: var(--text); border-color: #3a4f75; }
.cap-count { margin-left: auto; }
.cap-count.over { color: var(--down); font-weight: 700; }
.note-row { display: flex; gap: 8px; align-items: end; margin-top: 10px; }
.note-row .grow { flex: 1; }
.note-row input { width: 100%; }
.bt-box { margin-top: 10px; }
.bt { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.bt h4 { margin: 0 0 6px; font-size: 14px; }
.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bt-grid span { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.bt-grid b { font-size: 16px; color: var(--text); }
.warn-line { color: #fbbf24; margin: 4px 0; }
.legal { color: #fde7b0; background: #2a1f06; border: 1px solid #6b4d0b; border-radius: 10px; padding: 8px 12px; }
.row.tight { margin: 0; gap: 6px; }
.row.end { justify-content: flex-end; }
.param.bool { flex-direction: row; display: flex; align-items: center; gap: 10px; color: var(--muted); }
.param select { width: 100%; }
.strat .stat { margin: -4px 0 6px; }
.strat [data-defaults] { margin-top: 10px; }
.score-help { margin-top: 14px; }
.sc-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.sc-tile { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.sc-tile b { font-size: 26px; }
.sc-notes { grid-column: 1 / -1; margin: 0; }
.dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); max-width: 560px; width: calc(100vw - 32px); padding: 18px; }
.dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog ul { padding-left: 18px; }
@media (max-width: 980px) {
  .preview { display: none; }
  .preview.sheet-open { display: block; position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 92vh; overflow-y: auto; z-index: 40;
    margin: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .55); scroll-margin-top: 0; }
  .preview.sheet-open .preview-title { position: sticky; top: -18px; background: var(--panel); padding: 8px 0; z-index: 2; }
  .sheet-close { display: inline-flex; }
  body.sheet-lock { overflow: hidden; }
}
@media (max-width: 640px) {
  th.idx, td.idx, th.col-vol, td.col-vol, th.col-sig, td.col-sig, th.col-pct, td.col-pct { display: none; }
  .pct-m { display: block; }
  .table-wrap { overflow-x: visible; }
  td .nm { max-width: 42vw; }
  table.history th.col-id, table.history td.col-id { display: none; }
  .hero-buttons .btn-xl { max-width: none; font-size: 17px; padding: 14px 18px; }
  .kbd-hint { display: none; }
  .banner { padding: 8px 12px; font-size: 13px; }
}
@media (max-width: 1280px) {
  th.col-vol, td.col-vol { display: none; }
  td.sigs { min-width: 0; }
  .sigs .badge { white-space: normal; }
  .nm { max-width: 140px; }
  th, td { padding: 9px 6px; }
}
@media (max-width: 640px) {
  .sc-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .sc-tile { padding: 8px; }
  .sc-tile b { font-size: 18px; }
}

/* ---------- v2: piyasa anahtarı + rozet ---------- */
.market-badge { font-size: 12px; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 8px;
  background: var(--panel2); color: var(--accent); border: 1px solid var(--line); }
.market-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.market-switch button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.market-switch button:hover:not(:disabled) { color: var(--text); }
.market-switch button[aria-checked="true"] { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.market-switch button:disabled { opacity: .45; cursor: not-allowed; }
.market-switch .ms-sub { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 4px; }
body.switching main { opacity: .55; pointer-events: none; transition: opacity .15s; }
/* strateji kurulum ailesi rozeti */
.grp { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-left: 6px; border: 1px solid transparent; }
.grp-breakout { background: #3b2a06; color: #f5b82e; } .grp-momentum { background: #0f2d3d; color: #38bdf8; }
.grp-trend { background: #12391f; color: #4ade80; } .grp-volume { background: #2e1f45; color: #c084fc; }
.grp-reversal { background: #3d1515; color: #f87171; } .grp-intraday { background: #3a2412; color: #fb923c; }
.strat-groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
/* ---------- v2: yardım ---------- */
.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.help-toc { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; font-size: 14px; }
.help-toc ul { list-style: none; margin: 0; padding: 0; }
.help-toc li a { display: block; padding: 5px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.help-toc li a:hover, .help-toc li a.on { color: var(--text); background: var(--panel2); }
.help-toc li.l3 a { padding-left: 22px; font-size: 13px; }
.md { line-height: 1.6; max-width: 900px; }
.md h1, .md h2, .md h3 { scroll-margin-top: 80px; line-height: 1.25; }
.md h1 { font-size: 26px; margin-top: 4px; } .md h2 { font-size: 21px; margin-top: 30px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.md h3 { font-size: 17px; margin-top: 22px; }
.md img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.md code { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: .92em; }
.md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.md pre code { border: 0; padding: 0; }
.md blockquote { margin: 12px 0; padding: 6px 14px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; }
.md .md-table { overflow-x: auto; } .md table { margin: 10px 0; } .md td, .md th { white-space: normal; }
@media (max-width: 980px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  .market-switch .ms-sub { display: none; }
}
