:root {
  --accent: #0e7c66;
  --accent-2: #0a5f4e;
  --accent-soft: #d9f0ea;
  --bg: #f3f5f4;
  --panel: #ffffff;
  --chat-bg: #eae6df;
  --text: #15201d;
  --muted: #64716d;
  --line: #e3e8e6;
  --mine: #d6f5e3;
  --theirs: #ffffff;
  --danger: #c0392b;
  --read: #1d8fe1;
  --shadow: 0 1px 1.5px rgba(0,0,0,.12);
  --radius: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #21b893; --accent-2: #18a07f; --accent-soft: #123a31;
    --bg: #0b1416; --panel: #111c1f; --chat-bg: #0b1416;
    --text: #e6edeb; --muted: #8b9a96; --line: #1f2c2f;
    --mine: #0f4a3d; --theirs: #1b2629; --shadow: 0 1px 1.5px rgba(0,0,0,.4);
    --read: #53bdeb;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.ico { display: inline-flex; width: 24px; height: 24px; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- splash / giriş ---------- */
.splash { height: 100%; display: grid; place-items: center; }
.logo-mark {
  width: 72px; height: 72px; border-radius: 22px; margin: 0 auto;
  background: url(/icons/icon-192.png) center/cover;
  box-shadow: 0 8px 24px rgba(14,124,102,.25);
}
.auth { min-height: 100%; display: grid; place-items: center; padding: calc(24px + var(--safe-t)) 18px calc(24px + var(--safe-b)); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 22px; padding: 28px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.08); text-align: center; }
.auth-card h1 { margin: 14px 0 2px; font-size: 24px; }
.auth-card > p { margin: 0 0 18px; }
.note { background: var(--accent-soft); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 14px; }
.tabs { display: flex; background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .search {
  width: 100%; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 13px; font-size: 16px; outline: none; color: var(--text); font-weight: 400;
}
.field input:focus, .search:focus { border-color: var(--accent); background: var(--panel); }
.hint { font-size: 13px; color: var(--muted); margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.hint .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.err { color: var(--danger); font-size: 14px; min-height: 1px; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; background: var(--bg); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.primary.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.small { padding: 7px 11px; font-size: 14px; border-radius: 10px; }

/* ---------- iskelet ---------- */
.shell { display: flex; height: 100%; }
.pane { display: flex; flex-direction: column; min-width: 0; background: var(--panel); }
.list-pane { width: 100%; }
.chat-pane { flex: 1; display: none; background: var(--chat-bg); }
body.in-chat .list-pane { display: none; }
body.in-chat .chat-pane { display: flex; }
@media (min-width: 860px) {
  .list-pane { width: 360px; flex: none; border-right: 1px solid var(--line); display: flex !important; }
  .chat-pane { display: flex !important; }
  .back { display: none !important; }
}

.bar {
  display: flex; align-items: center; gap: 4px; padding: calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  min-height: calc(58px + var(--safe-t)); background: var(--panel); border-bottom: 1px solid var(--line); flex: none;
}
.bar .title { flex: 1; margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.icon-btn { border: 0; background: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn:active { background: var(--bg); }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .ico { width: 18px; height: 18px; }
body.offline .list-pane .bar .title::after { content: " · bağlanıyor…"; font-size: 13px; font-weight: 500; color: var(--muted); }

.banner { display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 10px 6px 10px 12px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; }
.banner span { flex: 1; }

/* ---------- sohbet listesi ---------- */
.conv-list, .user-list, .invite-list { list-style: none; margin: 0; padding: 0; }
.conv-list { overflow-y: auto; flex: 1; padding-bottom: var(--safe-b); }
.conv { display: flex; gap: 12px; align-items: center; padding: 10px 14px calc(10px) calc(14px + var(--safe-l)); cursor: pointer; }
.conv:active, .conv.active { background: var(--bg); }
.conv-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: -10px; }
.conv-top, .conv-bottom { display: flex; gap: 8px; align-items: center; }
.conv-name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 12px; color: var(--muted); }
.conv.unread .conv-time { color: var(--accent); font-weight: 600; }
.conv-pre { flex: 1; color: var(--muted); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.typing { color: var(--accent) !important; font-style: italic; }
.badge { background: var(--accent); color: #fff; border-radius: 999px; min-width: 21px; height: 21px; padding: 0 6px; font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.avatar {
  --h: 160; width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: hsl(var(--h) 45% 88%); color: hsl(var(--h) 45% 28%); font-weight: 700; font-size: 18px; letter-spacing: .02em;
}
@media (prefers-color-scheme: dark) { .avatar { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 60% 80%); } }
.avatar.group { border-radius: 16px; }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }
.avatar.group.sm { border-radius: 13px; }

.empty { text-align: center; color: var(--muted); padding: 40px 24px; }
.empty.big { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.empty.big .ico { width: 40px; height: 40px; color: var(--accent); }
.empty p { margin: 4px 0; }

/* ---------- sohbet ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-bar { gap: 2px; padding-left: calc(4px + var(--safe-l)); }
.chat-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 4px; border-radius: 10px; }
.chat-titles { min-width: 0; }
.chat-head .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.msgs { flex: 1; overflow-y: auto; padding: 10px calc(10px + var(--safe-r)) 10px calc(10px + var(--safe-l)); display: flex; flex-direction: column; gap: 2px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.loading { margin: auto; color: var(--muted); }
.e2e-note { align-self: center; max-width: 340px; text-align: center; font-size: 12.5px; background: #fdf3c4; color: #5b4f1d; padding: 8px 12px; border-radius: 10px; margin: 6px 0 10px; display: flex; gap: 6px; align-items: center; }
@media (prefers-color-scheme: dark) { .e2e-note { background: #2a2714; color: #d9cc8a; } }
.e2e-note .ico { width: 15px; height: 15px; flex: none; }
.day { align-self: center; margin: 10px 0 6px; }
.day span { background: var(--panel); color: var(--muted); font-size: 12.5px; padding: 5px 11px; border-radius: 8px; box-shadow: var(--shadow); }

.msg {
  max-width: min(78%, 520px); padding: 6px 9px 4px; border-radius: 12px; box-shadow: var(--shadow); position: relative;
  word-wrap: break-word; overflow-wrap: anywhere; margin-top: 6px;
}
.msg.grouped { margin-top: 1px; }
.msg.mine { align-self: flex-end; background: var(--mine); border-top-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: var(--theirs); border-top-left-radius: 4px; }
.msg.grouped.mine { border-top-right-radius: 12px; }
.msg.grouped.theirs { border-top-left-radius: 12px; }
.msg.failed { opacity: .75; cursor: pointer; }
.fail-note { align-self: flex-end; color: var(--danger); font-size: 12px; margin: 2px 4px; }
.sender { font-size: 13px; font-weight: 700; color: hsl(var(--h) 55% 38%); margin-bottom: 1px; }
@media (prefers-color-scheme: dark) { .sender { color: hsl(var(--h) 60% 70%); } }
.text { white-space: pre-wrap; font-size: 15.5px; }
.text .ico { width: 15px; height: 15px; vertical-align: -2px; }
.meta { float: right; margin: 6px 0 -2px 10px; font-size: 11.5px; color: var(--muted); display: flex; gap: 3px; align-items: center; line-height: 1; }
.tick { font-size: 12px; letter-spacing: -2px; }
.tick.read { color: var(--read); }
.tick.fail { color: var(--danger); letter-spacing: 0; }
.msg.has-photo { padding: 4px; }
.msg.has-photo .text { padding: 4px 5px 0; }
.msg.has-photo .meta { margin-right: 5px; }
.photo { display: block; max-width: 100%; width: 280px; height: auto; border-radius: 9px; cursor: zoom-in; background: var(--bg); }

.composer {
  display: flex; align-items: flex-end; gap: 6px; padding: 7px calc(8px + var(--safe-r)) calc(7px + var(--safe-b)) calc(6px + var(--safe-l));
  background: var(--bg); flex: none;
}
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none; border-radius: 22px; padding: 10px 15px; background: var(--panel); max-height: 140px; font-size: 16px; line-height: 1.35; box-shadow: var(--shadow);
}
.composer .attach { color: var(--muted); }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.send .ico { width: 21px; height: 21px; margin-left: 2px; }
.send:active { background: var(--accent-2); }

/* ---------- paneller ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); animation: fade .15s; }
.sheet-panel {
  position: relative; width: 100%; max-width: 520px; max-height: 92dvh; background: var(--panel); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; animation: up .2s ease-out; overflow: hidden;
}
.sheet-panel .bar { border-radius: 20px 20px 0 0; padding-top: 10px; min-height: 58px; }
.sheet-panel .bar .title { font-size: 18px; }
.sheet-body { overflow-y: auto; padding: 14px 16px calc(20px + var(--safe-b)); }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-panel { border-radius: 20px; max-height: 86vh; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.tight { gap: 4px; }
.profile { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0 6px; }
.profile h3 { margin: 10px 0 0; font-size: 20px; }
.card { background: var(--bg); border-radius: var(--radius); padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.card h4, .stack h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 4px; }
.card h4 .ico, .stack h4 .ico { width: 18px; height: 18px; }
.fp { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 16px; letter-spacing: .04em; word-spacing: .2em; color: var(--text); padding: 2px 0 6px; }
.fp.small { font-size: 14px; padding: 0 14px 10px 66px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; cursor: pointer; border-radius: 10px; }
.user-row:active { background: var(--bg); }
.user-main { flex: 1; min-width: 0; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.check.on { background: var(--accent); border-color: var(--accent); }
.invite { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.invite.used { opacity: .6; }
.invite .code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .06em; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

.viewer { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: var(--safe-t) 0 var(--safe-b); cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 40;
  background: #1d2725; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14.5px; max-width: calc(100% - 32px);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================= kılıf: BTC/USDT fiyat ekranı ================= */
.ticker {
  --up: #0ecb81; --down: #f6465d; --tk-bg: #0f1418; --tk-card: #171e24; --tk-text: #eaecef; --tk-muted: #848e9c;
  min-height: 100%; background: var(--tk-bg); color: var(--tk-text);
  padding: calc(14px + var(--safe-t)) calc(18px + var(--safe-r)) calc(14px + var(--safe-b)) calc(18px + var(--safe-l));
  display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto;
  font-variant-numeric: tabular-nums;
}
html:has(.ticker), body:has(.ticker) { background: #0f1418; }
.tk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tk-coin { display: flex; align-items: center; gap: 10px; }
.tk-sym { width: 38px; height: 38px; border-radius: 50%; background: #f7931a; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 21px; }
.tk-pair { font-size: 19px; font-weight: 700; }
.tk-pair span { color: var(--tk-muted); font-weight: 500; }
.tk-sub { font-size: 12.5px; color: var(--tk-muted); }
.tk-live { font-size: 12.5px; color: var(--tk-muted); display: flex; align-items: center; gap: 6px; }
.tk-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.tk-price { font-size: clamp(38px, 11vw, 52px); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; transition: color .6s; }
.tk-price.flash-up { animation: fu 1s; } .tk-price.flash-down { animation: fd 1s; }
@keyframes fu { 0% { color: var(--up); } } @keyframes fd { 0% { color: var(--down); } }
.tk-chg { font-size: 15px; font-weight: 600; margin-top: -4px; }
.tk-chg.up { color: var(--up); } .tk-chg.down { color: var(--down); }
.tk-ranges { display: flex; gap: 6px; margin-top: 6px; }
.tk-ranges button { border: 0; background: var(--tk-card); color: var(--tk-muted); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.tk-ranges button.on { background: #2b3139; color: var(--tk-text); }
.tk-chart { position: relative; height: 220px; background: var(--tk-card); border-radius: 14px; padding: 10px 6px 6px; }
.tk-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tk-chart .grid { stroke: #2b3139; stroke-width: 1; vector-effect: non-scaling-stroke; }
.tk-chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.tk-chart .up .line { stroke: var(--up); } .tk-chart .down .line { stroke: var(--down); }
.tk-chart .up .dot { fill: var(--up); } .tk-chart .down .dot { fill: var(--down); }
.tk-chart .up .g0 { stop-color: #0ecb81; stop-opacity: .28; } .tk-chart .down .g0 { stop-color: #f6465d; stop-opacity: .28; }
.tk-chart .g1 { stop-color: #0f1418; stop-opacity: 0; }
.tk-axis { position: absolute; right: 10px; top: 8px; bottom: 8px; display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--tk-muted); pointer-events: none; text-align: right; }
.tk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tk-stat { background: var(--tk-card); border-radius: 12px; padding: 11px 13px; }
.tk-stat .l { font-size: 12px; color: var(--tk-muted); }
.tk-stat .v { font-size: 16px; font-weight: 600; margin-top: 2px; }
.tk-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--tk-muted); }
.tk-mark { border: 0; background: none; padding: 11px; margin: -11px; opacity: .55; line-height: 0; }
.tk-mark:active { opacity: .9; }

.lock-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.lock-ico .ico { width: 28px; height: 28px; }
.btn.link { background: none; color: var(--muted); margin-top: 8px; }
