:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #16181d;
  --muted: #5d6470;
  --border: #e2e5ea;
  --accent: #d32f2f;
  --accent-ink: #ffffff;
  --ok: #1b8a4b;
  --warn: #b26a00;
  --err: #c62828;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --surface-2: #232730;
    --text: #eef0f3;
    --muted: #9aa3b0;
    --border: #2c313b;
    --accent: #ef5350;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 12px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 0; }
.boot { padding: 40px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; padding: 4px 10px 18px; }
.brand svg { width: 22px; height: 22px; fill: var(--accent); }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--surface-2); color: var(--accent); }
.side .who { position: absolute; bottom: 16px; left: 12px; right: 12px; font-size: 12px; color: var(--muted); padding: 0 10px; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 28px 32px; max-width: 1200px; width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.k { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi .v { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.checks label { display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 6px 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: default; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.badge.err { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.muted { color: var(--muted); }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > i { display: block; height: 100%; background: var(--accent); }

.auth { max-width: 380px; margin: 9vh auto; }
.auth .brand { justify-content: center; font-size: 20px; }
.keybox { background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); padding: 12px; border-radius: 8px; margin-top: 12px; }
.preview { display: flex; gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 12px; }
.preview img.ic { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--border); }
.preview .pt { font-weight: 700; }
.preview .pi { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.chart { width: 100%; height: 120px; }
.chart rect { fill: var(--accent); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50; }
#toast .t { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; margin-top: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
#toast .t.err { background: var(--err); color: #fff; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 10px 12px; }
  .brand { padding: 4px 8px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side .who { display: none; }
  .main { padding: 18px 16px; }
  .grid.k { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
}

/* ---------- Ortak ---------- */
.small { font-size: 12.5px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 8px; font-size: 13px; }
.callout { border-left: 3px solid var(--accent); }
.callout p { margin: 0 0 12px; }
.btn.lg { padding: 11px 22px; font-size: 15px; }
details.more { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "▸ "; }
details.more[open] summary::before { content: "▾ "; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; margin: 8px 0; }
.bar-row .progress { height: 8px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Site sayfası ---------- */
.site-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.site-head h1 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-align: center; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin: 0 0 16px; padding-left: 4px; }
.steps li:last-child { margin-bottom: 0; }
.steps pre { margin: 8px 0; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--border)); }
.dz-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.dz-row:first-of-type { border-top: 0; }
input[type=color] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

/* İzin kutusu önizlemesi (SDK kutucuğunun aynısı) */
.np-stage { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--bg) 10px, var(--bg) 20px); border-radius: 10px; padding: 24px 16px; }
.np-preview { display: flex; gap: 14px; max-width: 420px; margin: 0 auto; background: #fff; color: #1a1a1a; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 16px; font-size: 14px; line-height: 1.45; }
.np-bell { flex: 0 0 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--np) 12%, transparent); display: flex; align-items: center; justify-content: center; }
.np-bell svg { width: 24px; height: 24px; fill: var(--np); }
.np-body { flex: 1; min-width: 0; }
.np-t { font-weight: 700; font-size: 15px; }
.np-x { color: #444; }
.np-a { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.np-a span { font-weight: 600; border-radius: 9px; padding: 8px 14px; }
.np-l { color: #555; }
.np-y { background: var(--np); color: #fff; }

/* ---------- Gönder ---------- */
.send-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.send-form { padding: 22px; }
.send-form .field { margin-bottom: 16px; }
.send-form .field > label, .label-row label { display: block; font-weight: 600; margin: 0 0 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg label { margin: 0; font-weight: 600; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { margin: 0; cursor: pointer; font-weight: 500; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
.chip input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.send-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.send-preview { position: sticky; top: 20px; }
.os-note { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 14px; margin: 8px 0; }
.os-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.os-head img, .os-ic { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; }
.os-ic svg { width: 18px; height: 18px; fill: var(--accent); }
.os-title { font-weight: 700; margin-bottom: 2px; overflow-wrap: anywhere; }
.os-text { color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.os-img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; margin-top: 10px; background: var(--surface-2); }

@media (max-width: 860px) {
  .send-layout { grid-template-columns: 1fr; }
  .send-preview { position: static; order: -1; }
  .bar-row { grid-template-columns: 70px 1fr 56px; }
}
