/* TESPAM Sosyal — mobil uygulama */
:root {
  --ink: #0b1b33;        /* zemin lacivert */
  --deep: #10264a;       /* yüzey */
  --raise: #163259;      /* yükseltilmiş yüzey */
  --line: #24436f;       /* ayraç */
  --gold: #c9a24a;       /* TESPAM altın */
  --gold-soft: #e4cf98;
  --paper: #f5f2ea;      /* ana metin */
  --muted: #9fb0cf;      /* ikincil metin */
  --ok: #7fd19b;
  --warn: #f2c46b;
  --bad: #ff8f8f;
  --r-sm: 8px;
  --r-md: 14px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --tabbar: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink);
  color: var(--paper);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--gold-soft); }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- üst çubuk ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(11, 27, 51, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; text-decoration: none; }
.brand b { font-family: var(--serif); font-size: 21px; letter-spacing: .02em; color: var(--gold); }
.brand span { font-size: 15px; color: var(--muted); }
.trial {
  font-size: 13px; padding: 4px 10px; border-radius: 999px;
  border: 1px dashed var(--warn); color: var(--warn); background: none; cursor: pointer;
}

main { max-width: 720px; margin: 0 auto; padding: 18px 16px; }
h1 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.2; margin: 6px 0 4px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 19px; margin: 26px 0 10px; }
.lead { color: var(--muted); margin: 0 0 18px; max-width: 60ch; }

/* ---------- alt sekme çubuğu ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--deep); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--muted); text-decoration: none;
}
.tabs a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tabs a[aria-current="page"] { color: var(--gold); }
.tabs a.new svg { width: 30px; height: 30px; }
.tabs .count {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* ---------- segment seçici ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.seg button {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: none; color: var(--muted); cursor: pointer; font-size: 14px;
}
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* ---------- gönderi (dispatch) ---------- */
.dispatch {
  border-top: 1px solid var(--line);
  padding: 18px 0 20px;
}
.dispatch:first-of-type { border-top: 0; padding-top: 4px; }
.origin { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.origin .src { color: var(--gold-soft); }
.origin time { margin-left: auto; white-space: nowrap; }
.dispatch h3 { font-family: var(--serif); font-size: 19px; line-height: 1.3; font-weight: 600; margin: 0 0 6px; }
.dispatch p.body { margin: 0; color: #d9dfec; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.dispatch .link { display: block; font-size: 14px; margin-top: 6px; word-break: break-all; color: var(--muted); }
.thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.thumbs img { width: 112px; height: 112px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); flex: none; }

/* hesap şeridi: her hesabın bu gönderideki durumu */
.route { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding: 0; list-style: none; }
.route li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 4px 10px 4px 6px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.route li i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; background: var(--raise); color: var(--paper); }
.route li.ok { border-color: rgba(127, 209, 155, .5); color: var(--ok); }
.route li.ok i { background: var(--ok); color: var(--ink); }
.route li.error { border-color: rgba(255, 143, 143, .6); color: var(--bad); }
.route li.error i { background: var(--bad); color: var(--ink); }
.route li.manual { border-color: var(--warn); color: var(--warn); }
.route li.auto { border-style: dashed; }
.route a { color: inherit; }
.errline { font-size: 13px; color: var(--bad); margin: 6px 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- düğmeler ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--raise); color: var(--paper);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.ghost { background: none; }
.btn.danger { background: none; border-color: rgba(255, 143, 143, .5); color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: progress; }

/* ---------- formlar ---------- */
.field { margin: 0 0 16px; }
.field > label, .label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; min-height: 46px; padding: 11px 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--deep);
  font-size: 16px;
}
textarea.input { min-height: 160px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--gold); outline: none; }
.row { display: flex; gap: 8px; }
.row > .input { flex: 1; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* platform karakter sayaçları */
.meters { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.meters .over { color: var(--bad); font-weight: 600; }

/* hesap seçici */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--line);
  background: none; color: var(--muted); cursor: pointer; font-size: 14px;
}
.pick i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; background: var(--raise); color: var(--paper); }
.pick[aria-pressed="true"] { border-color: var(--gold); color: var(--paper); background: rgba(201, 162, 74, .12); }
.pick[aria-pressed="true"] i { background: var(--gold); color: var(--ink); }
.pick small { color: var(--muted); }

/* görsel seçici */
.media { display: flex; flex-wrap: wrap; gap: 8px; }
.media figure { position: relative; margin: 0; }
.media img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; }
.media figure button {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer;
}
.media .add {
  width: 96px; height: 96px; border-radius: var(--r-sm); border: 1px dashed var(--line);
  display: grid; place-items: center; text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; background: none;
}

details.over { border-top: 1px solid var(--line); padding: 12px 0; }
details.over summary { cursor: pointer; color: var(--muted); font-size: 14px; }

/* ---------- listeler (hesaplar, kaynaklar) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .name { font-weight: 600; }
.list .sub { font-size: 13px; color: var(--muted); word-break: break-word; }
.list .sub.bad { color: var(--bad); }
.plat {
  flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: var(--raise); color: var(--gold); font-weight: 700; font-size: 13px; border: 1px solid var(--line);
}
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.tag.gold { border-color: var(--gold); color: var(--gold); }

.menu { list-style: none; padding: 0; margin: 0; }
.menu a { display: flex; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--line); color: var(--paper); text-decoration: none; }
.menu a span { color: var(--muted); font-size: 14px; }

/* anahtar */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch input { appearance: none; flex: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); transition: transform .15s; }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(20px); }
.switch small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- boş durum, bildirim, giriş ---------- */
.empty { padding: 36px 0; color: var(--muted); }
.empty strong { display: block; color: var(--paper); font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px);
  max-width: 560px; margin: 0 auto; z-index: 30;
  padding: 12px 16px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
.toast.bad { background: var(--bad); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 380px; }
.login .mark { font-family: var(--serif); font-size: 40px; color: var(--gold); margin: 0; }
.login p { color: var(--muted); margin: 4px 0 28px; }

.banner { border: 1px dashed var(--warn); color: var(--warn); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.banner.info { border-color: var(--line); color: var(--muted); border-style: solid; }

pre.log { font-size: 12px; white-space: pre-wrap; word-break: break-all; color: var(--muted); background: var(--deep); padding: 12px; border-radius: var(--r-sm); }

.sheet-bg { position: fixed; inset: 0; background: rgba(5, 12, 24, .6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 720px; max-height: 88vh; overflow: auto; background: var(--deep); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

@media (min-width: 760px) {
  main { padding-top: 28px; }
  h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
