/* ============ Tasarım belirteçleri ============ */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #141b26;
  --muted: #64708a;
  --border: #e1e6ee;
  --border-strong: #c9d2df;
  --primary: #2481cc;
  --primary-hover: #1c6db0;
  --primary-soft: #e7f2fb;
  --on-primary: #ffffff;
  --success: #17915a;
  --success-soft: #e3f5eb;
  --warning: #b86e00;
  --warning-soft: #fff2d9;
  --danger: #d03b3b;
  --danger-soft: #fdeaea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --focus: 0 0 0 3px rgba(36, 129, 204, .28);
  /* Telegram önizleme */
  --tg-wall-a: #b5d3ea;
  --tg-wall-b: #cfe3c8;
  --tg-bubble: #ffffff;
  --tg-text: #0b0b0b;
  --tg-link: #168acd;
  --tg-meta: #7e8a96;
  --tg-quote-bar: #3a9be0;
  --tg-quote-bg: rgba(58, 155, 224, .1);
  --tg-code-bg: rgba(0, 0, 0, .06);
  --tg-btn-bg: rgba(44, 66, 88, .42);
  --tg-btn-text: #ffffff;
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #171e28;
    --surface-2: #1c2431;
    --text: #e8edf4;
    --muted: #93a0b5;
    --border: #283242;
    --border-strong: #38455a;
    --primary: #4aa3e8;
    --primary-hover: #6bb5ee;
    --primary-soft: #16303f;
    --on-primary: #06121c;
    --success: #43c187;
    --success-soft: #133024;
    --warning: #f0b24a;
    --warning-soft: #372a10;
    --danger: #f16a6a;
    --danger-soft: #3a1c1f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
    --focus: 0 0 0 3px rgba(74, 163, 232, .35);
    --tg-wall-a: #1f3346;
    --tg-wall-b: #22382e;
    --tg-bubble: #182533;
    --tg-text: #f5f5f5;
    --tg-link: #6ab7f5;
    --tg-meta: #7f93a6;
    --tg-quote-bar: #6ab7f5;
    --tg-quote-bg: rgba(106, 183, 245, .12);
    --tg-code-bg: rgba(255, 255, 255, .09);
    --tg-btn-bg: rgba(10, 20, 30, .55);
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171e28; --surface-2: #1c2431; --text: #e8edf4; --muted: #93a0b5;
  --border: #283242; --border-strong: #38455a; --primary: #4aa3e8; --primary-hover: #6bb5ee; --primary-soft: #16303f;
  --on-primary: #06121c; --success: #43c187; --success-soft: #133024; --warning: #f0b24a; --warning-soft: #372a10;
  --danger: #f16a6a; --danger-soft: #3a1c1f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.55); --focus: 0 0 0 3px rgba(74,163,232,.35);
  --tg-wall-a: #1f3346; --tg-wall-b: #22382e; --tg-bubble: #182533; --tg-text: #f5f5f5; --tg-link: #6ab7f5;
  --tg-meta: #7f93a6; --tg-quote-bar: #6ab7f5; --tg-quote-bg: rgba(106,183,245,.12); --tg-code-bg: rgba(255,255,255,.09);
  --tg-btn-bg: rgba(10,20,30,.55);
}

/* ============ Temel ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15.5px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }
svg.i { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.gap-lg { gap: 20px; }
.right { margin-left: auto; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Düzen ============ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; }
.logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 18px; flex: none;
  background: linear-gradient(135deg, #37aee2, #1e96c8);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: var(--muted);
  font-weight: 550; text-decoration: none; cursor: pointer;
}
.nav a svg { font-size: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav .cta {
  margin: 8px 0 10px; background: var(--primary); color: var(--on-primary); justify-content: center; font-weight: 650;
  box-shadow: 0 2px 8px rgba(36, 129, 204, .35);
}
.nav .cta:hover { background: var(--primary-hover); color: var(--on-primary); }
.sidebar .spacer { flex: 1; }
.side-foot { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.bot-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); font-size: 12.5px; color: inherit; text-decoration: none; }
.bot-pill:hover { background: var(--border); text-decoration: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.main { padding: 28px 34px 96px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.topbar { display: none; }

@media (max-width: 920px) {
  .app { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 14px;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-102%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .4); }
  .main { padding: 18px 16px 90px; }
}

/* ============ Kartlar ============ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { flex: 1; }
.card-body { padding: 18px 20px; }
.step {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.card.done .step { background: var(--success-soft); color: var(--success); }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }
.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.good .value { color: var(--success); } .stat.bad .value { color: var(--danger); } .stat.warn .value { color: var(--warning); }

/* ============ Düğmeler ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { font-size: 16px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15.5px; border-radius: 11px; }
.btn.icon { width: 34px; padding: 0; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn .spin { width: 15px; height: 15px; }

/* ============ Form ============ */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
label.field > .hint, .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.input.invalid { border-color: var(--danger); }
.input.sm { height: 32px; font-size: 13px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 1.35; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.check small { display: block; color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ============ Rozet / ilerleme ============ */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.running, .badge.queued { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge.completed { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.paused, .badge.scheduled { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge.cancelled, .badge.failed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.draft { background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge.warn { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge .pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.progress { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #37aee2, #2481cc); border-radius: 99px; transition: width .6s ease; }
.progress.done > i { background: var(--success); }
.progress.stripe > i { background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%); background-size: 22px 22px; animation: stripe 1s linear infinite; }
@keyframes stripe { to { background-position: 22px 0; } }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.btn.primary .spin { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Tablo ============ */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb-sm { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); flex: none; }

/* ============ Boş durum / uyarı ============ */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty > svg { font-size: 34px; opacity: .55; margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; font-size: 13.5px; align-items: flex-start; }
.alert svg { margin-top: 2px; font-size: 16px; }
.alert.info { background: var(--primary-soft); color: var(--text); }
.alert.info svg { color: var(--primary); }
.alert.warn { background: var(--warning-soft); }
.alert.warn svg { color: var(--warning); }
.alert.bad { background: var(--danger-soft); }
.alert.bad svg { color: var(--danger); }
.alert.ok { background: var(--success-soft); }
.alert.ok svg { color: var(--success); }
.alert b { font-weight: 650; }

/* ============ Yükleme alanı ============ */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 26px 18px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .12s, background .12s; background: var(--surface-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.dropzone svg { font-size: 28px; margin-bottom: 6px; }
.dropzone b { color: var(--text); }
.dropzone.compact { padding: 14px; }
.dropzone .up-progress { margin-top: 10px; }

/* ============ Medya ============ */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-tile { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: default; }
.media-tile .pic { aspect-ratio: 4 / 3; background: var(--surface-2) center / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 34px; }
.media-tile .meta { padding: 10px 12px; font-size: 12.5px; }
.media-tile .meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.media-tile .x { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .12s; }
.media-tile:hover .x { opacity: 1; }
.media-tile.pick { cursor: pointer; }
.media-tile.pick:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.media-chosen { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.media-chosen .pic { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--surface); flex: none; display: grid; place-items: center; font-size: 30px; color: var(--muted); border: 1px solid var(--border); }

/* ============ Toast / modal ============ */
.toasts { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: rise .18s ease; font-size: 13.5px; }
.toast.ok svg { color: #5ee2a0; } .toast.bad svg { color: #ff8d8d; } .toast svg { margin-top: 2px; font-size: 16px; flex: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(10, 16, 24, .55); display: grid; place-items: center; padding: 18px; animation: fade .12s ease; overflow: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: rise .16s ease; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 6px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 10px 22px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; flex-wrap: wrap; }

/* ============ Giriş ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, var(--primary-soft), transparent), var(--bg); }
.login-card { width: min(400px, 100%); padding: 30px; }
.login-card .logo { width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 14px; font-size: 26px; }

/* ============ Editör ============ */
.editor { border: 1px solid var(--border-strong); border-radius: 11px; background: var(--surface); overflow: visible; }
.editor:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.tb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: 11px 11px 0 0; position: sticky; top: 0; z-index: 5; }
.tb .sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 5px; }
.tb button {
  height: 32px; min-width: 32px; padding: 0 7px; border-radius: 7px; border: 0; background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.tb button svg { font-size: 16px; }
.tb button:hover { background: var(--border); }
.tb button.on { background: var(--primary-soft); color: var(--primary); }
.tb button .lbl { display: none; }
@media (min-width: 1200px) { .tb button .lbl.show { display: inline; } }
.tg-editor {
  min-height: 230px; max-height: 560px; overflow-y: auto; padding: 14px 16px; outline: none; white-space: pre-wrap; word-break: break-word;
  line-height: 1.5; font-size: 15px;
}
.tg-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.tg-editor a { color: var(--tg-link); text-decoration: underline; }
.tg-editor code { font-family: var(--mono); background: var(--tg-code-bg); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.tg-editor pre { font-family: var(--mono); background: var(--tg-code-bg); padding: 9px 12px; border-radius: 8px; margin: 4px 0; white-space: pre-wrap; font-size: .92em; display: block; }
.tg-editor blockquote { margin: 4px 0; padding: 4px 12px; border-left: 3px solid var(--tg-quote-bar); background: var(--tg-quote-bg); border-radius: 0 8px 8px 0; display: block; }
.tg-editor blockquote[data-expandable="1"]::after { content: "▾ ..."; color: var(--tg-quote-bar); font-size: 12px; display: block; }
.tg-editor .tg-spoiler { background: repeating-linear-gradient(45deg, var(--border-strong), var(--border-strong) 3px, var(--border) 3px, var(--border) 6px); color: transparent; border-radius: 4px; transition: color .15s; }
.tg-editor .tg-spoiler:hover, .tg-editor:focus .tg-spoiler.sel { color: inherit; background: var(--border); }
.tg-editor img { display: none; }
.editor-source { width: 100%; min-height: 230px; border: 0; outline: none; padding: 14px 16px; font-family: var(--mono); font-size: 13px; resize: vertical; background: transparent; border-radius: 0 0 11px 11px; }
.ed-foot { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.counter { font-variant-numeric: tabular-nums; font-weight: 600; }
.counter.over { color: var(--danger); } .counter.warn { color: var(--warning); }
.pop { position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 10px; }
.pop.emoji { width: 330px; max-width: calc(100vw - 30px); }
.emoji-tabs { display: flex; gap: 2px; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; overflow-x: auto; }
.emoji-tabs button { border: 0; background: transparent; padding: 4px 8px; border-radius: 7px; cursor: pointer; font-size: 18px; }
.emoji-tabs button.on, .emoji-tabs button:hover { background: var(--primary-soft); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 210px; overflow-y: auto; }
.emoji-grid button { border: 0; background: transparent; font-size: 21px; padding: 4px 0; border-radius: 7px; cursor: pointer; line-height: 1.2; }
.emoji-grid button:hover { background: var(--surface-2); }
.pop.symbols { width: 300px; }
.sym-list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.sym-list button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.sym-list button:hover { background: var(--surface-2); }
.sym-list .sample { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-list .name { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pop.link { width: 340px; }

/* ============ Besteci (yayın oluşturma) ============ */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.composer .col-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.composer .col-side { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 14px; }
/* Dar ekranda: Mesaj kartı → önizleme → test → alıcılar → gönder */
@media (max-width: 1080px) {
  .composer { grid-template-columns: 1fr; }
  .composer .col-main { display: contents; }
  .composer .col-main > :nth-child(1) { order: 1; }
  .composer .col-main > :nth-child(n+2) { order: 3; }
  .composer .col-side { position: static; order: 2; }
}
.save-ind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.save-ind.saved { color: var(--success); } .save-ind.error { color: var(--danger); }
.btn-row { display: flex; gap: 8px; align-items: center; }
.btn-row .input { flex: 1; min-width: 0; }
.btn-row .input.w-text { flex: 0 0 34%; }
.pill-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: var(--primary-soft); color: var(--primary); border-radius: 99px; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.result-list { display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 9px; background: var(--surface-2); font-size: 13.5px; }
.result.ok { background: var(--success-soft); } .result.bad { background: var(--danger-soft); }
.result .id { font-family: var(--mono); font-weight: 600; }
.result svg { margin-top: 3px; flex: none; }
.result.ok svg { color: var(--success); } .result.bad svg { color: var(--danger); }
.aud-opt { display: flex; gap: 12px; padding: 14px; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; align-items: flex-start; }
.aud-opt:hover { border-color: var(--border-strong); }
.aud-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.aud-opt input[type=radio] { margin-top: 3px; accent-color: var(--primary); }
.aud-opt .title { font-weight: 650; }
.found { padding: 12px 14px; border-radius: 10px; background: var(--success-soft); display: flex; gap: 12px; align-items: flex-start; }
.found svg { color: var(--success); font-size: 20px; margin-top: 2px; flex: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ============ Telegram önizleme ============ */
.tg-phone { border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: linear-gradient(160deg, var(--tg-wall-a), var(--tg-wall-b)); }
.tg-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(0, 0, 0, .12); color: #fff; backdrop-filter: blur(6px); }
.tg-head .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #37aee2, #1e96c8); display: grid; place-items: center; font-weight: 700; }
.tg-head b { display: block; line-height: 1.1; } .tg-head small { opacity: .8; font-size: 11.5px; }
.tg-chat { padding: 16px 12px 22px; min-height: 260px; max-height: calc(100vh - 170px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tg-msg { max-width: 100%; }
.tg-bubble { background: var(--tg-bubble); color: var(--tg-text); border-radius: 15px 15px 15px 4px; overflow: hidden; box-shadow: 0 1px 1px rgba(0, 0, 0, .13); max-width: 100%; }
.tg-media { display: block; width: 100%; max-height: 360px; object-fit: cover; background: #0002; }
.tg-media.ph { height: 150px; display: grid; place-items: center; color: var(--tg-meta); font-size: 34px; }
.tg-text { padding: 8px 12px 6px; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.38; }
.tg-text.empty { color: var(--tg-meta); font-style: italic; }
.tg-text a { color: var(--tg-link); text-decoration: none; }
.tg-text code { font-family: var(--mono); background: var(--tg-code-bg); padding: 0 4px; border-radius: 4px; font-size: .9em; }
.tg-text pre { font-family: var(--mono); background: var(--tg-code-bg); padding: 7px 10px; border-radius: 7px; margin: 3px 0; white-space: pre-wrap; font-size: .9em; }
.tg-text blockquote { margin: 3px 0; padding: 3px 10px; border-left: 3px solid var(--tg-quote-bar); background: var(--tg-quote-bg); border-radius: 0 6px 6px 0; }
.tg-text tg-spoiler { background: repeating-linear-gradient(45deg, #8895a3, #8895a3 3px, #7a8896 3px, #7a8896 6px); color: transparent; border-radius: 4px; cursor: pointer; transition: all .2s; }
.tg-text tg-spoiler.open { background: transparent; color: inherit; }
.tg-meta { padding: 0 10px 5px; text-align: right; font-size: 11.5px; color: var(--tg-meta); }
.tg-media + .tg-text { padding-top: 8px; }
.tg-caption-top .tg-text { order: -1; }
.tg-kb { display: flex; flex-direction: column; gap: 3px; margin-top: 3px; width: 100%; }
.tg-kb .r { display: flex; gap: 3px; }
.tg-kb .b { flex: 1; min-width: 0; text-align: center; padding: 8px 6px; border-radius: 8px; background: var(--tg-btn-bg); color: var(--tg-btn-text); font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(4px); }
.tg-note { font-size: 12px; color: #fff; background: rgba(0, 0, 0, .28); padding: 4px 10px; border-radius: 99px; align-self: center; margin: 2px 0; }

/* Art arda giden mesaj kartları (composer) */
.msg-list { display: flex; flex-direction: column; gap: 14px; }
.msg-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.msg-card.multi { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px 16px; background: var(--surface); }
.msg-head { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.msg-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.msg-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12.5px; flex: none; }
svg.i.flip { transform: rotate(180deg); }

/* ============ Rapor sayfası ============ */
.big-progress { padding: 22px; }
.big-progress .pct { font-size: 38px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.seg-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.seg-bar > i { display: block; height: 100%; transition: width .6s ease; }
code.inline { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre.code { background: #0f1720; color: #dbe7f3; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.55; margin: 0; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 10px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.divider { height: 1px; background: var(--border); margin: 4px 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { border: 1px solid var(--border); background: var(--surface); padding: 5px 13px; border-radius: 99px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.filters button.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.langsel { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; }
