:root {
  --bg: #0a0d13;
  --panel: #10151e;
  --panel-2: #141a25;
  --line: #1e2633;
  --line-2: #2a3445;
  --text: #d5dce8;
  --muted: #7b8699;
  --accent: #f29d38;
  --up: #22c77a;
  --down: #f0525c;
  --up-bg: rgba(34, 199, 122, .12);
  --down-bg: rgba(240, 82, 92, .12);
  --blue: #4c8dff;
  --bottom-nav-h: 58px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
.muted { color: var(--muted); font-weight: 400; }
.up { color: var(--up); }
.down { color: var(--down); }
.r { text-align: right; }
.num { font-variant-numeric: tabular-nums; }

/* ---- form öğeleri ---- */
input[type="text"], input[type="number"], input[type="password"], input:not([type]), select {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 6px 10px; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); }
button.ghost, button.primary, .stock-head .actions a, .stock-head .actions button {
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 700; }
button.ghost:hover, .stock-head .actions a:hover, .stock-head .actions button:hover { border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; }
button.sm { padding: 3px 9px; font-size: 12px; }
button.danger:hover, button.danger.confirm { border-color: var(--down); color: var(--down); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---- üst çubuk ---- */
.top {
  display: flex; align-items: center; gap: 18px;
  padding: 8px 16px; background: #0d1119; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-mark { background: var(--accent); color: #111; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.search { position: relative; flex: 0 1 340px; }
.search input, .watch-add input, .screener-filters input, .screener-filters select { width: 100%; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; max-height: 360px; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.search-results div { display: flex; gap: 10px; padding: 8px 10px; cursor: pointer; align-items: baseline; }
.search-results div.active, .search-results div:hover { background: #1c2433; }
.search-results b { min-width: 64px; }
.search-results span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 10px; border-radius: 5px; color: var(--muted); font-weight: 600; position: relative; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--accent); background: rgba(242, 157, 56, .1); }
.badge {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--down); color: #fff; font-size: 10px; line-height: 17px; text-align: center; font-weight: 700;
}
.status { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); white-space: nowrap; }
.delay { border: 1px solid var(--line-2); border-radius: 10px; padding: 1px 8px; font-size: 11px; }

/* ---- kayan şerit ---- */
.ticker {
  display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); background: #0c1017; scrollbar-width: none;
}
.ticker::-webkit-scrollbar { display: none; }
.ticker .t { padding: 6px 14px; border-right: 1px solid var(--line); white-space: nowrap; cursor: pointer; }
.ticker .t:hover { background: var(--panel-2); }
.ticker .t b { margin-right: 6px; }

/* ---- yerleşim ---- */
.layout { flex: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 0; }
.side { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
main { padding: 12px; overflow-y: auto; min-width: 0; }
.foot { padding: 6px 16px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.bottom-nav { display: none; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.panel-title {
  padding: 9px 12px; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.panel-title .grow { flex: 1; }
.panel-title button, .panel-title input { text-transform: none; letter-spacing: 0; font-weight: 500; }
.side .panel-title { border-bottom: 0; }
.watch-add { padding: 0 10px 8px; }

/* ---- tablolar ---- */
.grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 5px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid th { color: var(--muted); font-weight: 600; font-size: 11px; text-align: left; background: var(--panel); position: sticky; top: 0; z-index: 1; }
.grid th.r { text-align: right; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: #161d2a; }
.grid tr.sel td { background: rgba(242, 157, 56, .08); }
.sortable th { cursor: pointer; user-select: none; }
.sortable th:hover { color: var(--text); }
.sortable th.sorted { color: var(--accent); }
td.rm { width: 18px; padding: 0 8px; color: var(--muted); visibility: hidden; cursor: pointer; }
tr:hover td.rm { visibility: visible; }
td.rm:hover { color: var(--down); }
.name-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.pill { display: inline-block; min-width: 62px; text-align: right; padding: 1px 6px; border-radius: 4px; }
.pill.up { background: var(--up-bg); }
.pill.down { background: var(--down-bg); }
.chip { display: inline-block; padding: 1px 7px; border-radius: 10px; background: rgba(242, 157, 56, .14); color: var(--accent); font-size: 11px; font-weight: 700; }
.sub { display: block; font-size: 11px; color: var(--muted); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* ---- piyasa ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.card:hover { border-color: var(--line-2); }
.card .lbl { color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .val { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card .chg { font-variant-numeric: tabular-nums; font-size: 12px; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.market-grid .panel { margin: 0; }
.market-grid .name-cell { max-width: 0; width: 100%; }
.market-grid .grid td:first-child { width: 1%; }
.span2 { grid-column: span 2; }
.mini-chart { height: 280px; }

/* ---- hisse ---- */
.stock-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.stock-head img { width: 42px; height: 42px; border-radius: 50%; background: #fff; }
.stock-head .code { font-size: 22px; font-weight: 800; }
.stock-head .desc { color: var(--muted); }
.stock-head .price { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; margin-left: 18px; }
.stock-head .chg { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-head .actions { margin-left: auto; display: flex; gap: 8px; }
.star.on { color: var(--accent); border-color: var(--accent) !important; }

/* grafik ekranının üstündeki hızlı hisse şeridi */
.sym-bar {
  display: flex; gap: 8px; align-items: center; position: sticky; top: -12px; z-index: 6;
  margin: -12px -12px 12px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.sym-chips { position: relative; display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.sym-chips::-webkit-scrollbar { display: none; }
.sym-chip {
  flex: none; display: flex; gap: 6px; align-items: baseline; cursor: pointer; font-size: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 4px 11px; font-variant-numeric: tabular-nums;
}
.sym-chip:hover { border-color: var(--line-2); }
.sym-chip.active { border-color: var(--accent); background: rgba(242, 157, 56, .12); }
.sym-chip.active b { color: var(--accent); }
.sym-bar select { flex: none; padding: 4px 8px; font-size: 12px; }

/* hisse adının yanındaki ‹ THYAO ▾ › */
.code-row { display: flex; align-items: center; gap: 2px; }
.code-btn { background: none; border: 0; padding: 0 4px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.code-btn .code { font-size: 22px; font-weight: 800; }
.code-btn .caret { color: var(--accent); font-size: 14px; }
.code-btn:hover .code { color: var(--accent); }
.nav-arrow {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); cursor: pointer; font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px;
}
.nav-arrow:hover { border-color: var(--accent); color: var(--accent); }
.code-pos { font-size: 11px; color: var(--muted); margin-left: 6px; }

/* hisse seçici */
.picker { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 16px; }
.picker-box {
  width: min(460px, 100%); max-height: calc(100vh - 90px); display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.6);
}
.picker-head { display: flex; gap: 6px; }
.picker-head input { flex: 1; }
.picker-list { overflow-y: auto; margin: 0 -10px -10px; border-top: 1px solid var(--line); }
.picker-row { display: grid; grid-template-columns: 70px 1fr auto 70px; gap: 8px; align-items: baseline; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-variant-numeric: tabular-nums; }
.picker-row:hover { background: #161d2a; }
.picker-row.active { background: rgba(242, 157, 56, .1); }
.picker-row.active b { color: var(--accent); }
.picker-row .nm { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row .r { text-align: right; }
.rule select { padding: 3px 6px; font-size: 12px; }
.rule-tf-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rule-tf-note { font-size: 11px; }
.rule-msg { padding: 6px 12px; border-bottom: 1px solid var(--line); }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 5px; color: var(--muted); cursor: pointer; padding: 3px 7px; font-size: 14px; }
.icon-btn:hover { border-color: var(--line-2); color: var(--text); }
.icon-btn.danger:hover, .icon-btn.confirm { color: var(--down); border-color: var(--down); font-size: 12px; }
.alarm-box { gap: 10px; }
.alarm-row { display: grid; grid-template-columns: 1.2fr 1.3fr 1fr; gap: 6px; }
.alarm-row > * { width: 100%; }
#alarm-existing .rule { padding: 8px 0; }
.menu-box { padding: 6px 0; gap: 0; }
.menu-box a { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.menu-box a:last-child { border-bottom: 0; }
.menu-box a:active { background: #161d2a; }

.stock-signals { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -4px 0 12px; }
.legend .sig-note { color: var(--accent); margin-left: 6px; }
.pat { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pat.bull { background: var(--up-bg); color: var(--up); }
.pat.bear { background: var(--down-bg); color: var(--down); }
.pat.neutral { background: rgba(201, 162, 39, .14); color: #d8b24a; }
.pat:hover { border-color: currentColor; }
.pat small { font-weight: 400; opacity: .85; }

.chart-panel { position: relative; }
.chart-toolbar { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.btn-group { display: flex; gap: 2px; background: var(--panel-2); border-radius: 6px; padding: 2px; flex-wrap: wrap; }
.btn-group button { background: none; border: 0; padding: 4px 9px; border-radius: 4px; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 12px; }
.btn-group button:hover { color: var(--text); }
.btn-group button.active { background: #232d3f; color: var(--accent); }
.ind-row { display: flex; gap: 10px; flex-wrap: wrap; }
.legend { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.legend b { color: var(--text); font-weight: 600; margin-right: 8px; }
.chart { height: 460px; }
.chart-panel .chart-toolbar + .draw-hint { top: auto; }
.draw-hint {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 5; margin-top: 8px;
  background: rgba(76, 141, 255, .95); color: #fff; font-weight: 600; font-size: 12px; padding: 5px 12px; border-radius: 14px;
  pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
#draw-group button.confirm { color: var(--down); }
.cmp-btn.active { border-color: var(--accent); color: var(--accent); }
.cmp-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.cmp-chip i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); }
.cmp-chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; }
.cmp-chip button:hover { color: var(--down); }
#draw-group button:disabled { opacity: .35; }
.osc-wrap { position: relative; border-top: 1px solid var(--line); }
.osc-chart { height: 130px; }
.osc-label { position: absolute; top: 4px; left: 8px; z-index: 3; font-size: 11px; color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums; }
.osc-label i { font-style: normal; font-weight: 700; }
.chart-msg { position: absolute; inset: 50px 0 0; display: grid; place-items: center; color: var(--muted); background: rgba(16, 21, 30, .85); z-index: 4; }

.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 10px 16px; color: var(--muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-body { padding: 12px; }

.kv-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.kv { border: 1px solid var(--line); border-radius: 6px; }
.kv h4 { margin: 0; padding: 7px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--accent); border-bottom: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; padding: 4px 10px; border-bottom: 1px solid var(--line); gap: 10px; }
.kv div:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-variant-numeric: tabular-nums; text-align: right; }

.stmt-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.stmt th:first-child, .stmt td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 2; }
.stmt tr.group td { color: var(--accent); font-weight: 700; font-size: 11px; text-transform: uppercase; background: var(--panel-2); cursor: default; }
.stmt tbody tr { cursor: default; }
.stmt .yoy { display: block; font-size: 10px; }

.gauges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.gauge { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.gauge .lbl { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.gauge .sig { font-size: 18px; font-weight: 800; margin: 4px 0 8px; }
.gauge .bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--down), #6b7384 50%, var(--up)); position: relative; }
.gauge .bar i { position: absolute; top: -4px; width: 3px; height: 14px; background: #fff; border-radius: 2px; transform: translateX(-50%); }

/* ---- haberler ---- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news a:hover { color: var(--accent); }
.news .meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.news .meta .sym { color: var(--blue); cursor: pointer; margin-left: 6px; }
.news.compact { max-height: 420px; overflow-y: auto; }

/* ---- tarayıcı ---- */
.filters-box > summary { padding: 9px 12px; cursor: pointer; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.screener-filters { display: grid; grid-template-columns: 220px 220px 1fr; gap: 10px; padding: 0 10px 10px; align-items: start; }
.filter-pair { display: grid; gap: 6px; }
.filter-pair select { width: 100%; }
.ranges { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 10px; }
.ranges label { display: grid; grid-template-columns: 1fr 58px 58px; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.ranges input { padding: 3px 6px; width: 100%; border-radius: 4px; }
.screener-bar { display: flex; gap: 12px; align-items: center; padding: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.screener-bar #csv { margin-left: auto; }
#view-screener .table-wrap { max-height: calc(100vh - 290px); }

/* ---- sinyaller ---- */
.sig-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sig-head .title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.sig-head .grow { flex: 1; min-width: 200px; }
.sig-status { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; background: var(--muted); }
.dot.on { background: var(--up); box-shadow: 0 0 6px var(--up); }
#sig-table-wrap { max-height: 460px; }
.sig-preview-note { padding: 7px 12px; font-size: 12px; background: rgba(76, 141, 255, .1); color: #9cc0ff; border-bottom: 1px solid var(--line); }
.sig-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.sig-grid .panel { margin: 0 0 12px; }

.rule { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.rule-text { flex: 1; min-width: 0; }
.rule-text b { font-weight: 600; }
.rule-text .muted { font-size: 12px; overflow-wrap: anywhere; }
.rule.off .rule-text b { color: var(--muted); }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #2a3242; border-radius: 10px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #9aa4b5; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: rgba(242, 157, 56, .35); }
.switch input:checked + span::after { transform: translateX(14px); background: var(--accent); }

.editor { padding: 12px; display: grid; gap: 10px; border-top: 1px solid var(--line); background: var(--panel-2); }
.editor .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cond { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 96px minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.cond input, .cond select { width: 100%; }
.editor .actions, .settings .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.settings { padding: 12px; display: grid; gap: 12px; }
.field-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px; align-items: center; }
.field-row label { color: var(--muted); }
.settings fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 8px; }
.settings legend { padding: 0 4px; font-weight: 700; }
.help { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
p.help { padding-left: 0; }
.inline { display: flex; gap: 6px; }
.inline input { flex: 1; }
.msg { font-size: 12px; min-height: 16px; }
.msg.ok { color: var(--up); }
.msg.bad { color: var(--down); }
.push-box { border-color: rgba(242, 157, 56, .45) !important; }
.push-box legend { color: var(--accent); }
.more-channels > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }
.more-channels[open] > summary { margin-bottom: 10px; }
.more-channels fieldset + fieldset { margin-top: 12px; }
.access { border-top: 1px dashed var(--line-2); padding-top: 12px; display: grid; gap: 6px; }
.access code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.pin { font-size: 20px; font-weight: 800; letter-spacing: 4px; color: var(--accent); }
.note { margin: 0 2px 12px; font-size: 12px; }

/* ---- ısı haritası ---- */
.hm-controls select { text-transform: none; letter-spacing: 0; font-weight: 500; padding: 4px 8px; }
.hm-box { position: relative; height: calc(100vh - 215px); min-height: 420px; overflow: hidden; background: var(--bg); }
.hm-tile {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
  color: #fff; cursor: pointer; text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.hm-tile:hover { outline: 2px solid #fff; z-index: 2; }
.hm-tile b { font-weight: 800; }
.hm-sector { position: absolute; height: 15px; padding: 0 5px; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-legend { display: inline-flex; border-radius: 4px; overflow: hidden; font-size: 10px; text-transform: none; }
.hm-legend span { padding: 2px 7px; color: #fff; }

/* ---- mali tablo grafikleri ---- */
.fin-charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fin-chart { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px 4px; }
.fin-chart-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.fin-chart-head span { color: var(--muted); }
.fin-chart svg { width: 100%; height: 110px; display: block; }
.fin-chart text { fill: #7b8699; font-size: 9px; }

/* ---- sektör karşılaştırması ---- */
.sector-head { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 14px; margin-bottom: 12px; align-items: start; }
.sector-verdict { font-size: 20px; font-weight: 800; margin: 2px 0 4px; }
.kv-cmp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kv-cmp { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; display: grid; }
.kv-cmp span { color: var(--muted); font-size: 11px; }
.kv-cmp b { font-size: 16px; font-variant-numeric: tabular-nums; }
.kv-cmp em { font-style: normal; font-size: 11px; }
#presets button.active { background: #232d3f; color: var(--accent); }

/* ---- portföy ---- */
.pf-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 12px; }
.pf-grid .panel { margin: 0 0 12px; }
.pf-form { display: grid; grid-template-columns: 1.3fr .8fr .8fr .9fr 1fr 1fr 1.4fr auto; gap: 6px; padding: 10px 12px; }
.wbar { display: inline-block; width: 60px; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.wbar i { display: block; height: 100%; background: var(--accent); }
.wlist { padding: 8px 12px; display: grid; gap: 6px; }
.wrow { display: grid; grid-template-columns: 1fr 90px 48px; gap: 8px; align-items: center; font-size: 12px; }
.wrow .wbar { width: 100%; margin: 0; }
.wrow b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- izleme listesi sayfası ---- */
.wl-add { display: flex; gap: 6px; margin-left: auto; }
.wl-add input { width: 160px; }

/* ---- PIN ekranı ---- */
.auth { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 20px; }
.auth-box { width: min(360px, 100%); display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.auth-box p { margin: 0; color: var(--muted); }
.auth-box input { font-size: 24px; letter-spacing: 8px; text-align: center; padding: 10px; }
.auth-box button { padding: 10px; }

.empty { padding: 20px; color: var(--muted); text-align: center; }
.err { color: var(--down); }

@media (max-width: 1100px) {
  .market-grid { grid-template-columns: 1fr 1fr; }
  .screener-filters { grid-template-columns: 1fr 1fr; }
  .screener-filters .ranges { grid-column: span 2; }
  .sig-grid { grid-template-columns: 1fr; }
}

/* ---- telefon ---- */
@media (max-width: 800px) {
  body { font-size: 14px; }
  .top { gap: 10px; padding: 8px 10px; }
  .brand .brand-text { display: none; }
  .search { flex: 1; }
  .search input { font-size: 16px; } /* iOS'ta odaklanınca yakınlaştırmayı önler */
  .nav, .status, .foot { display: none; }
  .layout { grid-template-columns: 1fr; }
  .side { display: none; }
  main { padding: 8px 8px calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom, 0px)); }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #0d1119; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav a {
    flex: 1; height: var(--bottom-nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: 11px; font-weight: 600; position: relative;
  }
  .bottom-nav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav a.active { color: var(--accent); }
  .bottom-nav .badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 8px 10px; }
  .card .val { font-size: 17px; }
  .market-grid { grid-template-columns: 1fr; gap: 8px; }
  .span2 { grid-column: auto; }
  .market-grid .panel { overflow-x: auto; }
  .mini-chart { height: 220px; }

  .sym-bar { top: -8px; margin: -8px -8px 10px; padding: 8px; }
  .sym-bar select { font-size: 14px; }
  .sym-chip { font-size: 13px; padding: 6px 12px; }
  .nav-arrow { width: 36px; height: 36px; font-size: 20px; }
  .picker { padding: 0; align-items: flex-end; }
  .picker-box { width: 100%; max-height: 80vh; border-radius: 14px 14px 0 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .picker-row { grid-template-columns: 64px 1fr auto 64px; padding: 11px 12px; }
  .rule { flex-wrap: wrap; }
  .rule-text { flex-basis: calc(100% - 50px); }
  .stock-head { gap: 10px; }
  .stock-head img { width: 34px; height: 34px; }
  .stock-head .price { margin-left: auto; font-size: 22px; }
  .stock-head .actions { margin-left: 0; width: 100%; }
  .stock-head .actions > * { flex: 1; text-align: center; }
  /* Grafik araç çubuğu: periyot bir satır, göstergeler tek satırda yana kaydırılır */
  .chart-toolbar { gap: 6px; padding: 6px; }
  .chart-toolbar .btn-group { flex-wrap: nowrap; }
  #tf-group { width: 100%; justify-content: space-between; }
  .ind-row { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .ind-row::-webkit-scrollbar { display: none; }
  .ind-row .btn-group { flex: none; }
  .ind-row .btn-group button { white-space: nowrap; }
  .legend { margin-left: 0; width: 100%; font-size: 11px; }
  .stock-head .actions > * { padding: 5px 8px; }
  .chart { height: 340px; }
  .osc-chart { height: 110px; }
  .tabs button { padding: 10px 12px; }
  .kv-groups { grid-template-columns: 1fr; }

  .screener-filters { grid-template-columns: 1fr; }
  .screener-filters .ranges { grid-column: auto; grid-template-columns: 1fr; }
  .ranges label { grid-template-columns: 1fr 80px 80px; }
  #view-screener .table-wrap, #sig-table-wrap { max-height: none; }
  #sig-table-wrap td, #sig-history td { white-space: normal; }
  #sig-table-wrap .sub { max-width: 150px; }

  .field-row { grid-template-columns: 1fr; gap: 4px; }
  .hm-box { height: 70vh; min-height: 360px; }
  .pf-grid { grid-template-columns: 1fr; }
  .sector-head { grid-template-columns: 1fr; }
  .pf-form { grid-template-columns: 1fr 1fr; }
  .pf-form button { grid-column: span 2; }
  .hm-controls select { flex: 1 1 45%; }
  .cond { grid-template-columns: 1fr 1fr; }
  .cond button { grid-column: span 2; }
  .wl-add { margin-left: 0; width: 100%; }
  .wl-add input { flex: 1; width: auto; }
  input, select { font-size: 16px; }
  .btn-group button { padding: 6px 10px; }
  .grid th, .grid td { padding: 6px 8px; }
}

/* Dokunmatik cihazlarda "fareyle üzerine gelince" görünen öğeleri hep göster */
@media (hover: none) {
  td.rm { visibility: visible; }
}
