:root {
  --bg: #faf9f6; --panel: #ffffff; --ink: #1c1c20; --muted: #6b6b75; --line: #e3e0d8; --line2: #cfcbc0;
  --accent: #2f5fd0; --accent-ink: #ffffff; --danger: #c0392b; --ok: #1f8a4c; --warn: #b7791f;
  --tarih: #e0583f; --sanat: #2fb3a6; --bilim: #4a7be0; --spor: #3daa6d;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151518; --panel: #1d1d21; --ink: #ecebe6; --muted: #9a9aa5; --line: #2c2c32; --line2: #3a3a42; --accent: #6b92f0; --accent-ink: #0d0d10; --danger: #ef6f60; --ok: #4cc27c; --warn: #e0a84a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.25; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: none; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* üst çubuk */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: center; padding: 10px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -0.2px; }
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tab[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.grow { flex: 1; }
.progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.bar { width: 160px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ok); }
.me { color: var(--muted); font-size: 13px; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.sp { height: 12px; }

/* düğmeler & alanlar */
.btn { border: 1px solid var(--line2); background: var(--panel); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chip { border: 1px solid var(--line2); background: var(--panel); padding: 4px 11px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.tarih { background: var(--tarih); } .dot.sanat { background: var(--sanat); } .dot.bilim { background: var(--bilim); } .dot.spor { background: var(--spor); }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line2); background: var(--panel); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
label.f > span.hint { font-weight: 400; }

/* tablo */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 650; position: sticky; top: 53px; background: var(--bg); }
tr:hover td { background: color-mix(in srgb, var(--panel) 70%, var(--line)); }
.badge { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); } .badge.warn { color: var(--warn); border-color: var(--warn); } .badge.bad { color: var(--danger); border-color: var(--danger); }
.ttl { font-weight: 650; } .sub { color: var(--muted); font-size: 13px; }

/* editör */
.edit { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .edit { grid-template-columns: 1fr; } }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .cols2 { grid-template-columns: 1fr; } }
.side { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 80px); overflow: auto; }
.stab { display: flex; gap: 4px; margin-bottom: 8px; }
.stab button { flex: 1; }
.source { white-space: pre-wrap; font: 14px/1.6 Georgia, "Times New Roman", serif; max-height: 52vh; overflow: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.source h4 { margin: 12px 0 2px; font: 700 13px system-ui; color: var(--muted); }
.tagrow { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 6px; align-items: center; }
.cover-prev { width: 150px; aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; position: relative; background: #222; flex: none; }
.cover-prev canvas, .cover-prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-prev .yr { position: absolute; left: 10px; top: 8px; color: #fff; font: 700 22px Georgia, serif; text-shadow: 0 1px 3px #0006; }
.cover-prev .tt { position: absolute; left: 10px; right: 10px; bottom: 10px; color: #fff; font: 600 15px/1.15 Georgia, serif; text-shadow: 0 1px 3px #0008; }
.cover-prev::after { content: ""; position: absolute; inset: 0; background: linear-gradient(#0000004d, transparent 40%, #000000b8); }
.cover-prev .yr, .cover-prev .tt { z-index: 2; }
.check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.check li::before { content: "○ "; color: var(--muted); }
.check li.ok::before { content: "● "; color: var(--ok); }
.check li.warn::before { content: "▲ "; color: var(--warn); }
.savebar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 10px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stats { color: var(--muted); font-size: 13px; }
.stats b { color: var(--ink); }

/* giriş */
.login { max-width: 380px; margin: 12vh auto; display: flex; flex-direction: column; gap: 12px; }
.msg { font-size: 14px; } .msg.err { color: var(--danger); } .msg.ok { color: var(--ok); }
pre.sql { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font-size: 13px; user-select: all; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; max-width: 420px; font-size: 14px; box-shadow: 0 6px 20px #0004; }
.toast.err { background: var(--danger); color: #fff; }
.sel { width: 18px; height: 18px; }
