:root {
  --ink: #0e1f18;
  --muted: #4d6358;
  --paper: rgba(252, 255, 253, 0.94);
  --paper-deep: rgba(232, 245, 238, 0.88);
  --line: rgba(14, 48, 36, 0.14);
  --accent: #0b6b4f;
  --accent-2: #1a8f6a;
  --accent-soft: #d4efe4;
  --honey: #c47a12;
  --honey-soft: #fff3de;
  --teal: #0e6e7a;
  --teal-soft: #dff4f6;
  --danger: #b42318;
  --profit: #0a7a3e;
  --loss: #c0392b;
  --warn: #a15c00;
  --info: rgba(14, 110, 122, 0.12);
  --shadow: 0 10px 32px rgba(10, 40, 28, 0.09);
  --radius: 16px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-x: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  overflow-x: hidden;
  max-width: 100%;
}
body {
  padding-bottom: calc(0.5rem + var(--safe-bottom));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 520px at 6% -6%, #b8e4cf 0%, transparent 58%),
    radial-gradient(740px 440px at 96% 4%, #c9e8ec 0%, transparent 52%),
    radial-gradient(640px 380px at 70% 100%, #f3e2c4 0%, transparent 55%),
    linear-gradient(165deg, #eef8f2 0%, #e6efe9 42%, #e2ebe6 100%);
}
.top {
  display: flex; justify-content: space-between; gap: 0.65rem; align-items: flex-end; flex-wrap: wrap;
  padding: calc(0.7rem + var(--safe-top)) clamp(0.65rem, 2.5vw, 1.4rem) 0.25rem;
  padding-left: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  padding-right: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
}
.brand {
  font-family: var(--display); font-size: clamp(1.2rem, 3.2vw, 1.75rem); margin: 0; letter-spacing: -0.02em;
  background: linear-gradient(120deg, #0b6b4f 0%, #0e6e7a 55%, #1a8f6a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tag { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.82rem; }
.pillrow { display: flex; flex-wrap: wrap; gap: 0.28rem; }
.pill {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.2rem 0.55rem; font-size: 0.72rem; backdrop-filter: blur(8px);
}
.pill.on {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff; font-weight: 650;
}
.banner {
  margin: 0.35rem clamp(0.65rem, 2.5vw, 1.4rem); padding: 0.45rem 0.75rem; border-radius: 10px;
  background: linear-gradient(105deg, var(--teal-soft), var(--accent-soft));
  border: 1px solid rgba(14, 110, 122, 0.22); font-size: 0.8rem;
  margin-left: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  margin-right: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  border-left: 3px solid var(--teal);
  line-height: 1.35;
}
.banner b { color: var(--teal); }
.banner.phone-access {
  background: linear-gradient(105deg, var(--honey-soft), var(--accent-soft));
  border-color: rgba(196, 122, 18, 0.35);
  border-left-color: var(--honey);
  font-size: 0.78rem;
}
.banner.phone-access a {
  color: var(--accent);
  font-weight: 650;
  word-break: break-all;
}
.layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.35rem clamp(0.65rem, 2.5vw, 1.4rem) 1.25rem;
  padding-left: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  padding-right: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.main-col {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 0.75rem 0.9rem; box-shadow: var(--shadow); backdrop-filter: blur(10px); margin-bottom: 0.65rem;
  position: relative; overflow: hidden;
  max-width: 100%;
}
.panel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--teal));
  opacity: 0.85;
}
.sidebar { position: sticky; top: 0.45rem; align-self: start; max-height: calc(100vh - 0.9rem); overflow: auto; }
.sidebar.panel {
  margin-bottom: 0;
  background: linear-gradient(165deg, rgba(255,255,255,0.96), var(--paper-deep));
}
.sidebar.panel::before { background: linear-gradient(180deg, var(--honey), var(--accent)); }
.pref-details { border: 0; }
.pref-summary, .settings-summary, .ops-summary, .fold-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; flex-wrap: wrap; font-weight: 650;
}
.pref-summary::-webkit-details-marker,
.settings-summary::-webkit-details-marker,
.ops-summary::-webkit-details-marker,
.fold-summary::-webkit-details-marker { display: none; }
.pref-summary::after, .settings-summary::after, .ops-summary::after, .fold-summary::after {
  content: "▾"; color: var(--muted); font-weight: 400; margin-left: auto;
}
details[open] > .pref-summary::after,
details[open] > .settings-summary::after,
details[open] > .ops-summary::after,
details[open] > .fold-summary::after { content: "▴"; }
.ops-details > .ops-summary,
.fold-panel > .fold-summary { margin: 0; font-size: 0.95rem; color: #123528; }
.fold-panel > .fold-summary + * { margin-top: 0.45rem; }
.settings-sum-hint { font-weight: 400; font-size: 0.8rem; }
h2 { margin: 0 0 0.4rem; font-size: 0.95rem; color: #123528; }
h3 { margin: 0.55rem 0 0.25rem; font-size: 0.86rem; color: var(--teal); }
label { display: block; margin: 0.35rem 0; font-size: 0.78rem; color: var(--muted); }
label input, label select, .row input, .row select {
  display: block; width: 100%; margin-top: 0.18rem;
  border: 1px solid var(--line); border-radius: 8px; padding: 0.35rem 0.5rem;
  font: inherit; font-size: 15px; color: var(--ink); background: #fff; max-width: 100%;
}
label input:focus, label select:focus, .row input:focus, .row select:focus {
  outline: 2px solid rgba(11, 107, 79, 0.28); border-color: var(--accent);
}
label input[type="range"] { padding: 0; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 0.35rem; min-height: 1.85rem; }
.check input { width: auto; margin: 0; min-width: 1rem; min-height: 1rem; accent-color: var(--accent); }
.row { display: flex; gap: 0.35rem; align-items: center; margin-top: 0.3rem; }
.row.wrap { flex-wrap: wrap; }
.row input, .row select { width: auto; min-width: 90px; margin: 0; flex: 1; }
.btn {
  border: 0; border-radius: 9px; padding: 0.4rem 0.7rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent-soft); color: var(--ink);
  min-height: 36px; touch-action: manipulation;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 0.22rem 0.45rem; font-size: 0.78rem; min-height: 30px; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
}
.btn.danger { background: #fbe2df; color: var(--danger); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.row-close { white-space: nowrap; }
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: flex-start;
}
.metrics-hug .metric,
.metric {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  background: linear-gradient(160deg, #fff, #f3faf6);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.18rem 0.4rem 0.22rem;
  border-top: 2px solid var(--accent-2);
  line-height: 1.15;
}
.metric:nth-child(2) { border-top-color: var(--teal); }
.metric:nth-child(3) { border-top-color: var(--honey); }
.metric:nth-child(4) { border-top-color: #5c7cfa; }
.metric:nth-child(5) { border-top-color: #7c5cbf; }
.metric:nth-child(6) { border-top-color: #0e6e7a; }
.metric:nth-child(7) { border-top-color: #c47a12; }
.metric:nth-child(8) { border-top-color: #1a8f6a; }
.metric:nth-child(9) { border-top-color: #5c7cfa; }
.metric:nth-child(10) { border-top-color: var(--accent); }
.metric b { display: block; font-size: 0.82rem; margin-top: 0.02rem; color: #123528; line-height: 1.15; white-space: nowrap; }
.metric span { font-size: 0.65rem; color: var(--muted); line-height: 1.1; }
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  align-items: stretch;
}
.overview-grid.overview-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.overview-block {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255,255,255,0.92), rgba(236, 247, 241, 0.85));
}
.overview-block h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}
.overview-panel { padding-bottom: 0.55rem; }
.ops-panel { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.ops-card {
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255,255,255,0.95), rgba(236, 247, 241, 0.72));
}
.ops-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  color: #123528;
}
.ops-card ul {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.45;
}
.ops-card li + li { margin-top: 0.2rem; }
.overview-block .metrics {
  gap: 0.22rem;
  align-items: flex-start;
}
.overview-block .metrics-hug .metric {
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  padding: 0.14rem 0.36rem 0.16rem;
}
.overview-block .metric b { font-size: 0.78rem; }
.overview-block .metric span { font-size: 0.62rem; }
.overview-block .toolbar-row .btn { flex: 0 0 auto; }
.overview-block .log { max-height: 100px; }
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0;
}
.toolbar-row input[type="number"],
.toolbar-row input[type="text"],
.toolbar-row select {
  width: auto;
  min-width: 4.5rem;
  flex: 0 1 auto;
  margin: 0;
}
.toolbar-row #buySym { min-width: 7rem; }
.toolbar-row #buySymSelect { min-width: 8rem; flex: 1 1 8rem; }
.toolbar-row #watchSec { width: 3.5rem; min-width: 3.5rem; }
.log-details { margin-top: 0.35rem; }
.log:empty { display: none; }
.hint, .warn, .muted, .msg, .foot { font-size: 0.82rem; color: var(--muted); }
.ok-line { color: var(--ok, #2a9d8f) !important; }
.rate-ban { color: #c45c26 !important; font-weight: 600; }
.rate-soft { color: #9a7b2a !important; font-weight: 600; }

.hist-analytics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin: 0.4rem 0 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--card2, #f6f8f6);
  border: 1px solid var(--border, #dde5dd);
}
.hist-analytics.hidden { display: none; }
.hist-stat { display: flex; flex-direction: column; gap: 0.08rem; min-width: 5.5rem; width: auto; }
.hist-stat .lbl { font-size: 0.7rem; color: var(--muted, #667); line-height: 1.2; }
.hist-stat .val { font-size: 0.88rem; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.hist-stat .val.pos { color: #1a7a3a; }
.hist-stat .val.neg { color: #b33; }

.hist-masraf-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--teal, #0e6e7a);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-align: left;
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-masraf-btn:hover { color: var(--accent, #0b6b4f); }
tr.hist-main { cursor: pointer; }
tr.hist-main.hist-open td { box-shadow: inset 0 -2px 0 rgba(14, 110, 122, 0.35); }
tr.hist-detail-row td {
  background: rgba(14, 110, 122, 0.06);
  padding: 0.45rem 0.65rem 0.55rem;
  white-space: normal !important;
}
tr.hist-detail-row.hidden { display: none; }
.hist-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: flex-start;
}
.hist-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 5.5rem;
}
.hist-detail-item .lbl { font-size: 0.68rem; color: var(--muted, #667); }
.hist-detail-item .val { font-size: 0.84rem; font-weight: 600; }
.hist-detail-item .val.pnl-pos { color: #1a7a3a; }
.hist-detail-item .val.pnl-neg { color: #b33; }
.hist-leg-badge {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--teal, #0e6e7a);
  background: rgba(14, 110, 122, 0.12);
  border-radius: 4px;
  vertical-align: middle;
}
.hist-legs {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(14, 110, 122, 0.25);
}
.hist-legs-title {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted, #667);
  margin-bottom: 0.3rem;
}
.hist-legs table {
  width: 100%;
  max-width: 100%;
  font-size: 0.76rem;
  border-collapse: collapse;
}
.hist-legs th,
.hist-legs td {
  padding: 0.2rem 0.35rem;
  text-align: left;
  border-bottom: 1px solid rgba(14, 48, 36, 0.08);
  white-space: nowrap;
}
tr.hist-has-legs { cursor: pointer; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.35rem 0 0.5rem;
}
.pager.hidden { display: none; }
.pager .pg-info { font-size: 0.82rem; color: var(--muted, #667); margin-right: 0.35rem; }
.pager button {
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border, #ccd);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
}
.pager button.on { background: var(--accent, #2d6a4f); color: #fff; border-color: transparent; }
.pager button:disabled { opacity: 0.45; cursor: default; }
.hidden { display: none !important; }
.warn { color: var(--warn); }
.msg { min-height: 1em; margin: 0.25rem 0 0; }
.msg.ok { color: var(--accent); font-weight: 600; }
.msg.err { color: var(--danger); font-weight: 600; }
.hidden { display: none !important; }
.fut-box, .rules { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px dashed var(--line); }
.rules {
  font-size: 0.78rem;
  background: var(--honey-soft);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(196, 122, 18, 0.25);
  color: #7a4a08;
  line-height: 1.3;
}
.log {
  margin: 0.4rem 0 0; padding: 0.45rem 0.55rem; border-radius: 8px;
  background: linear-gradient(160deg, #0c1a15, #122820);
  color: #c8ecdb;
  font-size: 0.72rem; max-height: 140px; overflow: auto; white-space: pre-wrap;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(26, 143, 106, 0.35);
}
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.4rem 0 0.5rem;
  max-width: 100%;
  width: 100%;
  overscroll-behavior-x: contain;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
}
.pos-table-wrap {
  max-height: min(92vh, 1180px);
  background: transparent;
  border: none;
  padding: 0.05rem 0;
}
#posTable {
  font-size: 0.74rem;
  border-collapse: separate;
  /* Dikey boşluk yok: veri + komut tek kutu (eski border-spacing satırları ayırıyordu) */
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}
#posTable thead th {
  font-size: 0.7rem;
  padding: 0.28rem 0.38rem;
}
#posTable td {
  font-size: 0.74rem;
  padding: 0.26rem 0.38rem;
  line-height: 1.3;
  border-bottom: none;
}
#posTable td.act { width: 1%; text-align: right; white-space: nowrap; }
#posTable tbody tr.pos-data-row td {
  border-top: 1px solid var(--line);
  border-bottom: none;
}
#posTable tbody tr.pos-data-row td:first-child {
  border-left: 3px solid #0b6b4f;
  border-top-left-radius: 8px;
}
#posTable tbody tr.pos-data-row.side-short td:first-child {
  border-left-color: #c0392b;
}
#posTable tbody tr.pos-data-row td:last-child {
  border-right: 1px solid var(--line);
  border-top-right-radius: 8px;
}
#posTable tbody tr.pos-data-row td:not(:first-child):not(:last-child) {
  border-left: none;
  border-right: none;
}
#posTable tr.pos-cmd-row td {
  border: 1px solid var(--line);
  border-top: none;
  border-left-width: 3px;
  border-left-color: #0b6b4f;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0.22rem 0.42rem 0.32rem;
  white-space: normal !important;
  max-width: 0;
}
#posTable tr.pos-data-row.side-short + tr.pos-cmd-row td {
  border-left-color: #c0392b;
}
/* Global zebra/hover'ı pozisyon kutusunda iptal et; yön rengi */
#posTable tbody tr:nth-child(even) td,
#posTable tbody tr:nth-child(odd) td {
  background: inherit;
}
/* LONG = açık yeşil */
#posTable tbody tr.side-long.pos-data-row td,
#posTable tbody tr.side-long.pos-cmd-row td {
  background: #e8f6ee;
}
#posTable tbody tr.side-long.pos-cmd-row td {
  background: #dff2e7;
}
/* SHORT = açık kırmızı */
#posTable tbody tr.side-short.pos-data-row td,
#posTable tbody tr.side-short.pos-cmd-row td {
  background: #fdecea;
}
#posTable tbody tr.side-short.pos-cmd-row td {
  background: #f9e0dd;
}
#posTable tbody tr.side-long.pos-data-row:hover td,
#posTable tbody tr.side-long.pos-cmd-row:hover td {
  background: #d5efe0;
}
#posTable tbody tr.side-short.pos-data-row:hover td,
#posTable tbody tr.side-short.pos-cmd-row:hover td {
  background: #f5d4d0;
}
/* İşlem kutuları arası küçük boşluk */
#posTable tr.pos-cmd-row + tr.pos-data-row td {
  border-top: 1px solid var(--line);
  background-clip: padding-box;
  box-shadow: 0 -0.4rem 0 0 #f4f8f6;
}
.pos-cmd-last {
  font-size: 0.7rem;
  margin: 0 0 0.28rem;
  color: var(--ink, #222);
  white-space: normal;
  word-break: break-word;
}
.pos-cmd-last b { color: #0b6b3a; }
.pos-cmd-last .pos-sl-mark {
  color: #c0392b !important;
  font-weight: 800;
}
.pos-cmd-last .pos-tp-mark {
  color: #0a7a3e !important;
  font-weight: 700;
}
.pos-cmds .pos-sl-field {
  color: #c0392b;
  font-weight: 700;
}
.pos-cmds .pos-sl-field input.pos-cmd-sl {
  color: #c0392b;
  font-weight: 700;
  border-color: #e8a09a;
  background: #fff5f4;
}
.pos-cmds .pos-tp-field {
  color: #0a7a3e;
  font-weight: 650;
}
.pos-cmds .pos-sl-btn {
  color: #a32018;
  border-color: #e8a09a;
  background: #fde8e6;
}
.pos-cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem 0.32rem;
  align-items: center;
  font-size: 0.7rem;
  max-width: 100%;
}
.pos-cmds label {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  margin: 0;
  color: var(--muted, #666);
}
.pos-cmds input[type="number"] {
  width: 3.6rem;
  padding: 0.1rem 0.22rem;
  font-size: 0.7rem;
  min-height: 24px;
}
.pos-cmds .btn.sm {
  padding: 0.1rem 0.34rem;
  min-height: 24px;
  font-size: 0.7rem;
}
#posTable .row-close {
  padding: 0.1rem 0.34rem;
  min-height: 24px;
  font-size: 0.7rem;
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--line, #ccc);
  color: var(--muted, #555);
}
#buySymSelect { min-width: 140px; flex: 2; }
#topSelect { width: 100%; max-width: 100%; }
#topSelect option.tier-high { color: #0a7a3e; font-weight: 650; }
#topSelect option.tier-mid { color: #b45309; }
#topSelect option.tier-low { color: #78716c; }
.vol-tier-box {
  margin: 0.25rem 0 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.55);
}
.vol-tier-row { gap: 0.65rem 1rem; }
.vol-tier-row .check { font-size: 0.86rem; }
/* Varsayılan: içerik genişliği — taşma .table-wrap içinde kayar */
table { width: max-content; border-collapse: collapse; font-size: 0.84rem; }
/* Son turlar / pozisyonlar / geçmiş: satır kaydırma kutuda */
.table-stretch {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.table-stretch > table,
.table-stretch table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
}
.table-stretch th,
.table-stretch td {
  white-space: nowrap;
}
.table-stretch th.coin,
.table-stretch td.coin,
.table-stretch td.coin-cell,
.table-stretch th:first-child,
.table-stretch td:first-child {
  width: 1%;
  white-space: nowrap;
}
.table-stretch td.wide {
  width: auto;
  white-space: normal;
  min-width: 10rem;
}
th, td {
  text-align: left;
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  line-height: 1.35;
  vertical-align: middle;
}
th {
  color: #3d564a; font-weight: 650;
  background: linear-gradient(180deg, #eef7f2, #e4f0ea);
  position: sticky; top: 0; z-index: 1;
  font-size: 0.78rem;
}
/* Sayı sütunları: içeriğe sığ, üst üste binmesin */
th.num, td.num,
th.num-tight, td.num-tight {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 1%;
  padding-left: 0.4rem;
  padding-right: 0.45rem;
}
th.coin, td.coin { font-weight: 650; width: 1%; padding-right: 0.6rem; }
th.side, td.side { width: 1%; text-align: center; }
th.wide, td.wide { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; }
tbody tr:nth-child(even) td { background: rgba(11, 107, 79, 0.03); }
tbody tr:hover td { background: rgba(14, 110, 122, 0.07); }
td.pnl-pos, .pnl-pos { color: var(--profit) !important; font-weight: 700; }
td.pnl-neg, .pnl-neg { color: var(--loss) !important; font-weight: 700; }
td.pos-sl-cell, .pos-sl-cell { color: #c0392b !important; font-weight: 800; }
td.pos-tp-cell, .pos-tp-cell { color: #0a7a3e !important; font-weight: 700; }
tr.row-pnl-pos td { background: rgba(10, 122, 62, 0.1); }
tr.row-pnl-neg td { background: rgba(192, 57, 43, 0.1); }
tr.row-pnl-pos td.pnl-pos { background: rgba(10, 122, 62, 0.16); }
tr.row-pnl-neg td.pnl-neg { background: rgba(192, 57, 43, 0.16); }

/* Son turlar — durum / trend / AL-SAT */
.chip {
  display: inline-block; padding: 0.12rem 0.45rem; border-radius: 7px;
  font-weight: 650; font-size: 0.78rem; line-height: 1.35;
}
.chip-wait { background: var(--honey-soft); color: #8a5208; }
.chip-al { background: #d9f5e5; color: #0a6b36; }
.chip-sat { background: #fde2de; color: #a32018; }
.chip-skip { background: #e8eef5; color: #3d5670; }
.chip-err { background: #f8d7d4; color: #8f1d15; }
.chip-ok { background: #d4efe4; color: #0b6b4f; }
.trend-up { color: var(--profit); font-weight: 700; }
.trend-down { color: var(--loss); font-weight: 700; }
.trend-flat { color: var(--teal); font-weight: 600; }
.pct-hot { color: var(--profit); font-weight: 700; }
.pct-warm { color: #2f7d4e; font-weight: 650; }
.pct-cool { color: var(--muted); }
.pct-cold { color: #8a9a92; }
.coin-cell, td.coin { font-weight: 700; color: #123528; }
button.coin-link, a.coin-link {
  color: inherit;
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-decoration: none;
  border-bottom: 1px dashed rgba(18, 53, 40, 0.35);
  cursor: pointer;
}
button.coin-link:hover, a.coin-link:hover {
  color: var(--accent, #1a7f4b);
  border-bottom-color: currentColor;
}
td.coin-cell .coin-link { display: inline-block; padding: 0.05rem 0; }

/* Uzun yardım metinleri daha az yer kaplasın */
.panel > p.muted { margin: 0.15rem 0 0.35rem; line-height: 1.3; }
.panel > .row + .muted { margin-top: 0.2rem; }

table.mini td:first-child { font-weight: 600; width: 35%; }
.tabs { display: flex; gap: 0.28rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.3rem 0.65rem; cursor: pointer; font: inherit; font-size: 0.82rem;
  min-height: 34px; touch-action: manipulation;
}
.tab.on {
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff; border-color: transparent;
}
.settings-panel {
  margin: 0.35rem clamp(0.65rem, 2.5vw, 1.4rem) 0.45rem;
  margin-left: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
  margin-right: max(clamp(0.65rem, 2.5vw, 1.4rem), var(--safe-x));
}
.settings-panel > .settings-summary { margin-bottom: 0.25rem; }
.settings-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.45rem;
  margin-bottom: 0.25rem;
}
.settings-head .tabs { margin: 0; }
.settings-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.55rem 0.85rem;
  margin-top: 0.35rem;
}
.settings-grid .check { margin-top: 0.2rem; }
.algo-toolbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.65rem 1rem;
  margin: 0.35rem 0 0.25rem;
}
.algo-mode {
  display: inline-flex; border: 1px solid var(--line); border-radius: 999px;
  overflow: hidden; background: rgba(255,255,255,0.7);
}
.algo-mode-btn {
  border: 0; background: transparent; font: inherit; font-size: 0.82rem;
  padding: 0.4rem 0.85rem; cursor: pointer; color: var(--muted);
  min-height: 34px; touch-action: manipulation;
}
.algo-mode-btn.on {
  background: linear-gradient(135deg, #0b6b4f, #0f766e);
  color: #fff; font-weight: 600;
}
.algo-empty-msg {
  margin: 0.35rem 0 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.algo-filter { max-width: 22rem; margin: 0; flex: 1 1 12rem; }
.algo-root { display: flex; flex-direction: column; gap: 0.85rem; max-height: min(72vh, 760px); overflow: auto; padding: 0.1rem 0.35rem 0.35rem 0.05rem; }
.algo-cat {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(255,255,255,0.96), var(--paper-deep));
  padding: 0.65rem 0.8rem 0.85rem;
  border-left-width: 4px;
}
.algo-cat-blurb {
  margin: -0.15rem 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #57534e;
}
.algo-summary {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #78716c;
}
.algo-cat[data-cat="sinyal"] {
  border-left-color: #0b6b4f;
  background: linear-gradient(165deg, #f2faf6, #e4f2eb);
}
.algo-cat[data-cat="risk_cikis"] {
  border-left-color: #b45309;
  background: linear-gradient(165deg, #fff8f1, #fdecd8);
}
.algo-cat[data-cat="confluence"] {
  border-left-color: #0369a1;
  background: linear-gradient(165deg, #f0f9ff, #dbeafe);
}
.algo-cat[data-cat="izleyici"] {
  border-left-color: #0f766e;
  background: linear-gradient(165deg, #f0fdfa, #ccfbf1);
}
.algo-cat[data-cat="ogrenme"] {
  border-left-color: #a16207;
  background: linear-gradient(165deg, #fefce8, #fef3c7);
}
.algo-cat[data-cat="koruma"] {
  border-left-color: #be123c;
  background: linear-gradient(165deg, #fff1f2, #fecdd3);
}
.algo-cat[data-cat="korelasyon"] {
  border-left-color: #4d7c0f;
  background: linear-gradient(165deg, #f7fee7, #ecfccb);
}
.algo-cat[data-cat="akış"] {
  border-left-color: #155e75;
  background: linear-gradient(165deg, #ecfeff, #cffafe);
}
.algo-cat[data-cat="maliyet"] {
  border-left-color: #57534e;
  background: linear-gradient(165deg, #fafaf9, #e7e5e4);
}
.algo-cat h3 {
  margin: 0 0 0.55rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  font-size: 0.95rem;
}
.algo-cat[data-cat="sinyal"] h3 { color: #0b6b4f; }
.algo-cat[data-cat="risk_cikis"] h3 { color: #9a3412; }
.algo-cat[data-cat="confluence"] h3 { color: #075985; }
.algo-cat[data-cat="izleyici"] h3 { color: #0f766e; }
.algo-cat[data-cat="ogrenme"] h3 { color: #854d0e; }
.algo-cat[data-cat="koruma"] h3 { color: #9f1239; }
.algo-cat[data-cat="korelasyon"] h3 { color: #3f6212; }
.algo-cat[data-cat="akış"] h3 { color: #155e75; }
.algo-cat[data-cat="maliyet"] h3 { color: #44403c; }
.algo-cat .algo-count { font-weight: 400; font-size: 0.75rem; color: var(--muted); }
.algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.65rem 0.75rem;
  align-items: start;
}
.algo-field {
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 4.8rem;
  padding: 0.45rem 0.5rem 0.5rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.55);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.algo-field:hover, .algo-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 40, 60, 0.04);
}
.algo-field-head {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
  min-height: 1.35rem;
}
.algo-label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.algo-unit { font-weight: 500; color: var(--muted); font-size: 0.72rem; }
.algo-field input[type="number"],
.algo-field input[type="text"],
.algo-field select {
  width: 100%;
  margin: 0;
}
.algo-input-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.algo-check-text { font-weight: 500; }
.restart-tag {
  display: inline-block; flex-shrink: 0; margin-top: 0.05rem;
  font-size: 0.62rem; font-weight: 650;
  color: var(--honey); background: var(--honey-soft); border-radius: 999px; padding: 0.08rem 0.38rem;
  white-space: nowrap;
}
.tip-btn {
  flex-shrink: 0;
  width: 1.15rem; height: 1.15rem;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  cursor: help;
  line-height: 1;
  user-select: none;
}
.tip-field .tip-bubble {
  display: none;
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  z-index: 50;
  width: min(22rem, 78vw);
  max-width: 22rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #163042;
  color: #f4f8fb;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(10, 30, 45, 0.28);
  pointer-events: none;
}
.tip-field .tip-bubble p { margin: 0 0 0.4rem; }
.tip-field .tip-bubble p:last-child { margin-bottom: 0; }
.tip-field .tip-bubble .algo-tip-meta,
.tip-field .tip-bubble .tip-meta {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.18);
  color: rgba(240, 248, 255, 0.82);
  font-size: 0.72rem;
}
.tip-field .tip-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: #9fd6ff;
}
.tip-field:hover .tip-bubble,
.tip-field:focus-within .tip-bubble,
.tip-field .tip-btn:focus + .tip-bubble,
.tip-field .tip-btn:hover + .tip-bubble {
  display: block;
}
/* Son satırlarda tooltip yukarı açılsın */
.algo-cat .algo-field:nth-last-child(-n+3) .tip-bubble {
  top: auto;
  bottom: calc(100% + 4px);
}
.algo-field.hidden-by-search { display: none !important; }
.algo-cat.hidden-by-search { display: none !important; }

/* Statik ayar satırları (Telegram / Binance / Program) */
.settings-grid > label.tip-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.4rem 0.45rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.settings-grid > label.tip-field:hover,
.settings-grid > label.tip-field:focus-within {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  background: rgba(255,255,255,0.7);
}
.settings-grid > label.tip-field .tip-label-row {
  display: flex; align-items: center; gap: 0.35rem;
}
.settings-grid > label.tip-field.check .tip-label-row { order: 1; }
.settings-grid > label.tip-field.check input[type="checkbox"] { margin-right: 0.25rem; }
details summary { cursor: pointer; }
.foot {
  padding: 0 max(0.85rem, var(--safe-x)) calc(1.25rem + var(--safe-bottom));
}
.foot a { color: var(--accent); }

/* —— Tablet (dar masaüstü) —— */
@media (max-width: 1200px) and (min-width: 961px) {
  .layout {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
    gap: 0.5rem;
  }
  .overview-grid.overview-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .overview-block { padding: 0.45rem 0.5rem; }
  .overview-block h2 { font-size: 0.92rem; }
  .overview-block .btn { font-size: 0.76rem; }
}

/* —— Tablet dikey / büyük telefon —— */
@media (max-width: 960px) {
  html, body { overflow-x: hidden; }
  .layout {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.25rem 0.5rem 1.1rem;
    padding-left: max(0.5rem, var(--safe-x));
    padding-right: max(0.5rem, var(--safe-x));
  }
  .main-col { order: 1; min-width: 0; }
  .sidebar {
    order: 2;
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 0.4rem;
    width: 100%;
  }
  .top {
    align-items: flex-start;
    gap: 0.4rem;
    padding-bottom: 0.15rem;
  }
  .pillrow {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
  }
  .pillrow .pill,
  .pillrow .btn {
    flex: 0 0 auto;
  }
  #statusPills {
    display: contents;
  }
  .banner {
    font-size: 0.74rem;
    padding: 0.4rem 0.55rem;
    margin-top: 0.2rem;
    margin-bottom: 0.25rem;
  }
  .panel {
    padding: 0.55rem 0.6rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
  }
  .settings-panel {
    margin-left: max(0.5rem, var(--safe-x));
    margin-right: max(0.5rem, var(--safe-x));
  }
  .overview-grid,
  .overview-grid.overview-3,
  .ops-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .overview-block {
    padding: 0.5rem 0.55rem;
  }
  .overview-block .toolbar-row {
    gap: 0.35rem;
  }
  .overview-block .toolbar-row .btn {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: calc(50% - 0.35rem);
    min-height: 40px;
  }
  .overview-block .toolbar-row .btn.primary,
  .overview-block .toolbar-row .btn.danger {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .metrics { gap: 0.25rem; }
  .metric {
    max-width: calc(50% - 0.2rem);
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
  }
  .overview-block .metrics-hug .metric {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
    max-width: calc(50% - 0.15rem);
  }
  .row { flex-wrap: wrap; gap: 0.35rem; }
  .row input,
  .row select,
  .row .btn {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
    min-height: 42px;
  }
  .btn.row-close {
    width: auto;
    flex: 0 0 auto;
    min-height: 36px;
  }
  .btn {
    min-height: 40px;
  }
  .btn.sm {
    min-height: 38px;
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
  }
  .toolbar-row {
    gap: 0.35rem;
  }
  .toolbar-row > .btn,
  .toolbar-row > input,
  .toolbar-row > select {
    flex: 1 1 auto;
    min-height: 40px;
  }
  .toolbar-row #watchSec {
    width: 4rem;
    min-width: 4rem;
    flex: 0 0 4rem;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.3rem;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
  }
  .tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0.35rem 0.7rem;
  }
  .hist-analytics {
    gap: 0.3rem;
    padding: 0.35rem 0.4rem;
  }
  .hist-stat {
    min-width: calc(50% - 0.3rem);
    flex: 1 1 calc(50% - 0.3rem);
  }
  .pager {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .pager button {
    min-width: 38px;
    min-height: 38px;
  }
  th, td {
    font-size: 0.76rem;
    padding: 0.34rem 0.4rem;
  }
  /* Mobilde tablolar yatay kaydırılır; sütunlar ezilmesin */
  .table-wrap {
    margin-left: -0.15rem;
    margin-right: -0.15rem;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .table-stretch > table,
  .table-stretch table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }
  .table-wrap::after {
    content: "← kaydır →";
    display: block;
    text-align: center;
    font-size: 0.66rem;
    color: var(--muted);
    padding: 0.2rem 0 0.05rem;
  }
  .pos-table-wrap { max-height: min(85vh, 980px); }
  #posTable td.act {
    text-align: left;
    position: sticky;
    right: 0;
    background: inherit;
    z-index: 1;
  }
  .log { max-height: 110px; font-size: 0.7rem; }
  .foot {
    font-size: 0.75rem;
    padding-bottom: calc(1rem + var(--safe-bottom));
  }
}

/* —— Küçük telefon —— */
@media (max-width: 560px) {
  .brand { font-size: 1.12rem; }
  .tag { font-size: 0.72rem; }
  .banner { font-size: 0.7rem; line-height: 1.3; }
  .panel { padding: 0.5rem 0.5rem; }
  .overview-block h2 { font-size: 0.9rem; }
  .metric b { font-size: 0.76rem; }
  .metric span { font-size: 0.6rem; }
  .overview-block .metric b { font-size: 0.74rem; }
  .pill { font-size: 0.66rem; padding: 0.16rem 0.4rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-sum-hint { display: inline; }
  .hist-analytics {
    gap: 0.25rem;
  }
  .hist-stat {
    min-width: calc(50% - 0.25rem);
    flex: 1 1 calc(50% - 0.25rem);
  }
  #topSelect { size: auto; height: 8.5rem; }
  .log { max-height: 100px; }
  .btn.primary,
  .btn.danger { width: 100%; }
  .overview-block .toolbar-row .btn {
    flex: 1 1 100%;
    min-width: 100%;
  }
  .toolbar-row #buySymSelect,
  .toolbar-row #buySym,
  .toolbar-row #buySide {
    flex: 1 1 100%;
    min-width: 100%;
    width: 100%;
  }
  label input,
  label select,
  .row input,
  .row select {
    font-size: 16px; /* iOS zoom engeli */
  }
}

@media (min-width: 961px) {
  .pref-summary { pointer-events: none; }
  .pref-summary::after { display: none; }
  .settings-sum-hint { display: none; }
}

html[data-theme="dark"] #posTable tbody tr.side-long.pos-data-row td,
html[data-theme="dark"] #posTable tbody tr.side-long.pos-cmd-row td {
  background: rgba(18, 48, 36, 0.92);
}
html[data-theme="dark"] #posTable tbody tr.side-long.pos-cmd-row td {
  background: rgba(14, 42, 30, 0.95);
}
html[data-theme="dark"] #posTable tbody tr.side-short.pos-data-row td,
html[data-theme="dark"] #posTable tbody tr.side-short.pos-cmd-row td {
  background: rgba(52, 24, 24, 0.92);
}
html[data-theme="dark"] #posTable tbody tr.side-short.pos-cmd-row td {
  background: rgba(44, 18, 18, 0.95);
}
html[data-theme="dark"] #posTable td.act {
  background: inherit;
}

/* Login gate */
.login-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 30, 22, 0.55); backdrop-filter: blur(8px);
  padding: 1rem;
}
.login-gate.hidden { display: none !important; }
.login-card {
  width: min(380px, 100%);
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.25rem; box-shadow: var(--shadow);
}
.spark-wrap {
  margin-top: 0.55rem; padding: 0.5rem 0.55rem; border-radius: 10px;
  background: linear-gradient(160deg, #f4fbf7, #eaf4f5);
  border: 1px solid var(--line);
}
.spark-head { display: flex; justify-content: space-between; gap: 0.4rem; margin-bottom: 0.25rem; flex-wrap: wrap; }
#sparkCanvas { width: 100%; height: 72px; display: block; }

/* Dark theme */
html[data-theme="dark"] {
  --ink: #e6f2eb;
  --muted: #9bb3a6;
  --paper: rgba(18, 32, 28, 0.94);
  --paper-deep: rgba(14, 28, 24, 0.92);
  --line: rgba(180, 220, 200, 0.14);
  --accent: #2ec98a;
  --accent-2: #1fa870;
  --accent-soft: #1a3d32;
  --honey: #e0a84a;
  --honey-soft: #3a2e18;
  --teal: #4ec4d1;
  --teal-soft: #16353a;
  --danger: #ff7b72;
  --profit: #3dd68c;
  --loss: #ff8a7a;
  --warn: #e0a84a;
  --info: rgba(78, 196, 209, 0.14);
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] body { background: #0b1411; }
html[data-theme="dark"] .bg {
  background:
    radial-gradient(900px 520px at 8% -8%, #14352c 0%, transparent 55%),
    radial-gradient(700px 420px at 100% 0%, #123038 0%, transparent 50%),
    linear-gradient(165deg, #0d1613, #101c18 50%, #0c1411);
}
html[data-theme="dark"] label input,
html[data-theme="dark"] label select,
html[data-theme="dark"] .row input,
html[data-theme="dark"] .row select,
html[data-theme="dark"] .tab,
html[data-theme="dark"] .metric {
  background: #15241f; color: var(--ink);
}
html[data-theme="dark"] .table-wrap { background: rgba(12, 22, 18, 0.8); }
html[data-theme="dark"] .overview-block {
  background: linear-gradient(165deg, rgba(18, 32, 28, 0.95), rgba(14, 28, 24, 0.9));
  border-color: rgba(120, 160, 140, 0.25);
}
html[data-theme="dark"] th { background: linear-gradient(180deg, #1a2e27, #15241f); color: #b9d0c4; }
html[data-theme="dark"] .spark-wrap { background: linear-gradient(160deg, #14241e, #123038); }
html[data-theme="dark"] .brand {
  background: linear-gradient(120deg, #3dd68c, #4ec4d1);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="dark"] .btn.ghost { color: var(--ink); }
html[data-theme="dark"] .rules { color: #f0d7a4; }
html[data-theme="dark"] .algo-cat[data-cat="sinyal"] {
  background: linear-gradient(165deg, #14352c, #102820); border-left-color: #2ec98a;
}
html[data-theme="dark"] .algo-cat[data-cat="risk_cikis"] {
  background: linear-gradient(165deg, #3a2a14, #2a1f10); border-left-color: #e0a84a;
}
html[data-theme="dark"] .algo-cat[data-cat="confluence"] {
  background: linear-gradient(165deg, #123038, #0f2830); border-left-color: #4ec4d1;
}
html[data-theme="dark"] .algo-cat[data-cat="izleyici"] {
  background: linear-gradient(165deg, #123530, #0f2a28); border-left-color: #2dd4bf;
}
html[data-theme="dark"] .algo-cat[data-cat="ogrenme"] {
  background: linear-gradient(165deg, #352e12, #2a2410); border-left-color: #eab308;
}
html[data-theme="dark"] .algo-cat[data-cat="koruma"] {
  background: linear-gradient(165deg, #3a1820, #2a1218); border-left-color: #ff7b72;
}
html[data-theme="dark"] .algo-cat[data-cat="korelasyon"] {
  background: linear-gradient(165deg, #243018, #1a2412); border-left-color: #a3e635;
}
html[data-theme="dark"] .algo-cat[data-cat="akış"] {
  background: linear-gradient(165deg, #123038, #0e252c); border-left-color: #22d3ee;
}
html[data-theme="dark"] .algo-cat[data-cat="maliyet"] {
  background: linear-gradient(165deg, #242420, #1a1a18); border-left-color: #a8a29e;
}
html[data-theme="dark"] .algo-cat[data-cat="sinyal"] h3,
html[data-theme="dark"] .algo-cat[data-cat="izleyici"] h3 { color: #2ec98a; }
html[data-theme="dark"] .algo-cat[data-cat="risk_cikis"] h3,
html[data-theme="dark"] .algo-cat[data-cat="ogrenme"] h3 { color: #e0a84a; }
html[data-theme="dark"] .algo-cat[data-cat="confluence"] h3,
html[data-theme="dark"] .algo-cat[data-cat="akış"] h3 { color: #4ec4d1; }
html[data-theme="dark"] .algo-cat[data-cat="koruma"] h3 { color: #ff7b72; }
html[data-theme="dark"] .algo-cat[data-cat="korelasyon"] h3 { color: #a3e635; }
html[data-theme="dark"] .algo-cat[data-cat="maliyet"] h3 { color: #a8a29e; }

