:root {
  --bg: #0b0f14;
  --bg2: #10161d;
  --card: #141b24;
  --card2: #1a232e;
  --line: #243040;
  --text: #e6edf3;
  --muted: #8b98a8;
  --dim: #5d6b7b;
  --green: #39ff88;
  --green2: #22c55e;
  --red: #ff5c6c;
  --amber: #fbbf24;
  --orange: #fb923c;
  --blue: #60a5fa;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--green2); }
.down { color: var(--red); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── boot / login ─────────────────────────────── */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); }
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #12311f 0%, transparent 60%), var(--bg);
}
.login-box { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login-box h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -0.02em; }
.login-box p { margin: 0; color: var(--muted); }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--green2); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); cursor: pointer; white-space: nowrap; transition: background .15s, opacity .15s;
}
.btn:hover { background: #222d3a; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--green2); border-color: var(--green2); color: #04120a; font-weight: 600; }
.btn.primary:hover { background: #2fdc6c; }
.btn.danger { color: var(--red); }
.btn.block { width: 100%; padding: 13px; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.err { color: var(--red); font-size: 14px; }

/* ── layout ───────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(11, 15, 20, .92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding-top: var(--safe-t);
}
.top-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
@media (max-width: 380px) { .brand b { font-size: 15px; } .top .pill { padding: 4px 8px; font-size: 12px; } }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.live { background: var(--green); box-shadow: 0 0 0 0 rgba(57,255,136,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(57,255,136,0); } 100% { box-shadow: 0 0 0 0 rgba(57,255,136,0); } }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 0; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 10px 12px; border: 0; background: none; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; font-weight: 500;
}
.tab.on { color: var(--text); border-bottom-color: var(--green); }
main { max-width: 1200px; margin: 0 auto; padding: 16px 16px calc(40px + var(--safe-b)); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { font-size: 17px; margin: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ── market strip ─────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; }
.stat .s { font-size: 12.5px; margin-top: 2px; }

/* ── cards ────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: border-color .15s, transform .1s;
}
.card:hover { border-color: #33455a; }
.card:active { transform: scale(.995); }
.cards { display: grid; gap: 10px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; }
.card h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px;
  background: var(--card2); color: var(--muted); border: 1px solid var(--line); font-weight: 500;
}
.chip.new { color: var(--amber); border-color: #5b4a17; }
.reasons { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
.reasons li { display: flex; gap: 6px; }
.reasons .flag { color: #ffb4bc; }
.metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.metrics b { color: var(--text); font-weight: 600; }

/* skor halkası */
.score {
  --p: 0; --c: var(--dim);
  width: 50px; height: 50px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #1f2a36 0);
  position: relative; font-weight: 700; font-size: 16px;
}
.score::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.score span { position: relative; }
.score.lg { width: 72px; height: 72px; font-size: 24px; }
.score.lg::before { background: var(--bg2); }
.delta { font-size: 11.5px; text-align: center; margin-top: 3px; }

/* ── list rows (DEX / Altcoin tabloları) ──────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.toolbar .input { width: auto; padding: 9px 12px; }
.toolbar .search { flex: 1; min-width: 160px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 10px; border-radius: 9px; cursor: pointer; color: var(--muted); font-size: 13.5px; }
.seg button.on { background: var(--card2); color: var(--text); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.lrow {
  display: grid; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line);
  grid-template-columns: 44px 1fr 90px 76px; cursor: pointer;
}
.lrow:first-child { border-top: 0; }
.lrow:hover { background: #17202b; }
.lrow.head { cursor: default; background: var(--bg2); font-size: 12px; color: var(--muted); padding-top: 8px; padding-bottom: 8px; }
.lrow.head:hover { background: var(--bg2); }
.lrow .score { width: 40px; height: 40px; font-size: 14px; }
.lrow .score::before { inset: 3px; }
.lrow .c-hide { display: none; }
.lrow .r { text-align: right; }
@media (min-width: 820px) {
  .lrow { grid-template-columns: 44px minmax(160px, 1.4fr) 100px 90px 80px 80px 80px 90px minmax(160px, 2fr); }
  .lrow .c-hide { display: block; }
}
.sym { font-weight: 650; }
.sub { font-size: 12px; color: var(--muted); }

/* ── detail sheet ─────────────────────────────── */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; animation: fade .15s; }
.sheet {
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--bg2); border-top: 1px solid var(--line); border-radius: 20px 20px 0 0;
  padding: 8px 18px calc(24px + var(--safe-b)); animation: up .2s ease-out;
}
@media (min-width: 820px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 5vh; transform: translateX(-50%); width: 760px;
           max-height: 90vh; border-radius: 20px; border: 1px solid var(--line); animation: fade .15s; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 10px; }
.sheet h2 { margin: 0; font-size: 21px; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
@media (min-width: 600px) { .kv { grid-template-columns: repeat(4, 1fr); } }
.kv div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.kv span { display: block; font-size: 11.5px; color: var(--muted); }
.kv b { font-size: 15px; }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 110px 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; }
.bar .track { height: 8px; background: #1f2a36; border-radius: 6px; overflow: hidden; position: relative; }
.bar .fill { position: absolute; top: 0; bottom: 0; border-radius: 6px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.spark { width: 100%; height: 90px; display: block; }

/* ── news / posts ─────────────────────────────── */
.feed { display: grid; gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.item .t { font-weight: 550; color: var(--text); }
.item .m { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { cursor: pointer; flex: none; padding: 5px 11px; font-size: 13px; }
.chips .chip.on { background: #12311f; color: var(--green); border-color: #1d5a37; }
.post-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; margin-top: 4px; }

/* ── tables (performans) ──────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; border-top: 0; }
.scroll-x { overflow-x: auto; }

.note { background: #1c1a10; border: 1px solid #4a3f14; color: #f3d77a; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.ok-note { background: #0f2418; border: 1px solid #1d5a37; color: #9ff0c0; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 80;
  background: var(--card2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: up .2s; max-width: 90vw;
}
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
