:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --border: #e3e6eb;
  --text: #1c2129; --muted: #667085; --primary: #2f62d6; --primary-ink: #ffffff;
  --success: #1f8a5b; --success-bg: #e8f6ef; --danger: #c93535; --warn-bg: #fff6e0; --warn: #8a5a00;
  --mark: #ffe58a; --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --surface: #171b21; --surface-2: #1e232b; --border: #2a313b;
    --text: #e6e9ee; --muted: #98a2b3; --primary: #6b95f2; --primary-ink: #0b1020;
    --success: #4cc38a; --success-bg: #12301f; --danger: #f07070; --warn-bg: #3a2e10; --warn: #f3c969;
    --mark: #6b5a12; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; margin: 0 0 .6em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 48px; min-height: 70vh; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.narrow { max-width: 760px; margin: 0 auto; }

/* üst çubuk */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.search { flex: 1; max-width: 460px; }
.search input { width: 100%; }
.usernav { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; font-size: 1.1rem; }
.bell:hover { text-decoration: none; }
.badge { position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 5px; font-weight: 700; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; color: var(--muted); }
.menu-list { position: absolute; right: 0; top: 130%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 170px; padding: 6px; display: flex; flex-direction: column; }
.menu-list a, .menu-list .linklike { padding: 8px 10px; border-radius: 6px; color: var(--text); text-align: left; }
.menu-list a:hover, .menu-list .linklike:hover { background: var(--surface-2); text-decoration: none; }

/* form ögeleri */
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 90px; font-family: var(--font); }
label { display: block; font-weight: 600; font-size: .92rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 5px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-sm { padding: 5px 11px; font-size: .88rem; }
.btn.danger, .act.danger { color: var(--danger); }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; color: var(--primary); }

.flash { background: var(--success-bg); color: var(--success); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

/* ana sayfa */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.hero { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 14%, var(--surface)), var(--surface)); border: 1px solid var(--border); border-radius: 14px; padding: 26px 26px 22px; margin-bottom: 20px; }
.hero h1 { margin-top: 0; } .hero p { color: var(--muted); margin: 0 0 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2, .section-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 12px 0; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.active { background: var(--text); color: var(--bg); }
.sidebar .card h3 { font-size: .95rem; }
.catlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.stats { display: flex; justify-content: space-around; text-align: center; }
.stats div { display: flex; flex-direction: column; } .stats b { font-size: 1.2rem; } .stats span { color: var(--muted); font-size: .8rem; }

.catpill { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--text); }
.catpill::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--cat, var(--primary)); }
.tag { font-size: .8rem; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; }
.tag:hover { color: var(--text); text-decoration: none; }

/* konu listesi */
.topics { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topic-row { display: flex; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--border); align-items: center; }
.topic-row:first-child { border-top: 0; }
.topic-row.pinned { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.tr-main { flex: 1; min-width: 0; }
.tr-title { font-weight: 650; color: var(--text); font-size: 1.02rem; display: block; overflow-wrap: anywhere; }
.tr-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; font-size: .85rem; }
.tr-stats { display: flex; gap: 14px; align-items: center; text-align: center; flex-shrink: 0; }
.stat { display: flex; flex-direction: column; min-width: 48px; } .stat b { font-size: 1rem; } .stat span { font-size: .72rem; color: var(--muted); }
.stat.zero b { color: var(--muted); }
.tr-last { min-width: 80px; font-size: .8rem; text-align: right; }
.flag { font-size: .85rem; }
.solved-tag { background: var(--success-bg); color: var(--success); font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 6px; margin-right: 4px; vertical-align: middle; white-space: nowrap; display: inline-block; }
.solved-tag.big { font-size: .85rem; }

.pager { display: flex; gap: 4px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 5px 11px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; }
.pager .current { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.pager .gap { border: 0; background: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-head { border-left: 5px solid var(--cat, var(--primary)); padding-left: 14px; }
.crumbs { font-size: .85rem; color: var(--muted); }

/* konu sayfası */
.topic-head { margin-bottom: 18px; }
.solved-box { border: 1px solid var(--success); background: var(--success-bg); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.solved-label { color: var(--success); font-weight: 700; margin-bottom: 6px; }
.posts { display: flex; flex-direction: column; gap: 14px; }
.post { display: grid; grid-template-columns: 150px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); scroll-margin-top: 80px; }
.post:target { outline: 2px solid var(--primary); }
.post.is-solution { border-color: var(--success); }
.post.is-deleted { opacity: .55; }
.post-author { padding: 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.pa-info { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pa-name { font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.role { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); padding: 1px 6px; border-radius: 4px; }
.role.op { color: var(--muted); background: var(--surface-2); }
.role.danger { color: var(--danger); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--av, #6b7280); flex-shrink: 0; }
.avatar:hover { text-decoration: none; }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; }
.post-main { padding: 14px 18px; min-width: 0; display: flex; flex-direction: column; }
.post-meta { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.post-meta a { color: var(--muted); }
.post-body { overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; } .post-body > :last-child { margin-bottom: 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 6px; }
.post-body pre { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: .88rem; }
.post-body code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 4px solid var(--border); color: var(--muted); }
.post-body table { border-collapse: collapse; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 5px 10px; }
.post-body a.mention { font-weight: 600; }
.clamp { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.post-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: auto; padding-top: 12px; font-size: .88rem; }
.post-actions form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.post-actions input[type=text] { width: 160px; padding: 3px 8px; font-size: .85rem; }
.act { background: none; border: 0; font: inherit; color: var(--muted); cursor: pointer; padding: 2px 0; }
.act:hover { color: var(--text); text-decoration: none; }
.vote { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 2px 6px; }
.vbtn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .85rem; padding: 2px 5px; border-radius: 4px; }
.vbtn:hover:not(:disabled) { color: var(--primary); }
.vbtn.on.up { color: var(--success); } .vbtn.on.down { color: var(--danger); }
.vbtn:disabled { cursor: default; opacity: .5; }
.score { font-weight: 700; min-width: 1.4em; text-align: center; }
.report { position: relative; }
.report summary { list-style: none; } .report summary::-webkit-details-marker { display: none; }
.report-form { position: absolute; z-index: 5; right: 0; bottom: 130%; width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 12px; flex-direction: column; align-items: stretch !important; }
.report-form label { font-weight: 400; display: flex; gap: 6px; }
.report-form label input { width: auto; margin: 0; }
.modbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.modbar form { display: inline-flex; gap: 6px; margin: 0; } .modbar input { width: 200px; padding: 4px 8px; }
.reply-box { margin-top: 24px; }
.reply-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.reply-form .editor { width: 100%; }

.editor { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.editor textarea { border: 0; border-radius: 0; }
.editor textarea:focus { outline: none; }
.editor-tabs { display: flex; gap: 2px; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface-2); padding: 4px; flex-wrap: wrap; }
.editor-tabs button { background: none; border: 0; padding: 4px 10px; border-radius: 6px; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; }
.editor-tabs button.active { background: var(--surface); color: var(--text); font-weight: 600; }
.editor-tabs .hint { margin-left: auto; font-size: .75rem; color: var(--muted); padding-right: 6px; }
.editor .preview { padding: 12px; min-height: 120px; }
.tips { border-left: 4px solid var(--primary); }

/* arama, bildirim, profil */
.searchbig { display: flex; gap: 8px; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 10px; }
.snippet { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px; }
.notes { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.notes li { border-top: 1px solid var(--border); } .notes li:first-child { border-top: 0; }
.notes a { display: flex; gap: 12px; align-items: center; padding: 12px 16px; color: var(--text); }
.notes a:hover { background: var(--surface-2); text-decoration: none; }
.notes li.unread { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.notes .muted { margin-left: auto; white-space: nowrap; }
.note-kind { width: 26px; text-align: center; font-weight: 700; color: var(--primary); }
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-head > div:nth-child(2) { flex: 1; min-width: 220px; }
.profile-head h1 { margin: 0; }
.bio { white-space: pre-line; }
.profile-head .stats { gap: 18px; }
.userlist { padding-left: 1.4em; }
.userlist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.userlist .avatar { width: 32px; height: 32px; font-size: .85rem; }
.rep { margin-left: auto; }

.auth { max-width: 420px; margin: 24px auto; padding: 26px; }
.auth h1 { margin-top: 0; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.errorpage { padding: 50px 0; } .errorpage .code { font-size: 4rem; font-weight: 800; color: var(--muted); }
.prose { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 28px 20px; }
.prose li { margin-bottom: 6px; }

/* moderasyon */
.tabs.sub { margin-top: 0; }
.quoted { border-left: 3px solid var(--border); padding-left: 12px; margin: 10px 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 180px; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.log { list-style: none; padding: 0; }
.catform .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0; }
.catform .wide { grid-column: span 3; }
.catform input[type=color] { width: 100%; height: 38px; padding: 2px; margin-top: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 18px 0; font-size: .88rem; }
.footer .wrap { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.footer a { color: var(--muted); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { order: -1; } .sidebar .card:not(.stats) { display: none; }
  .catform .grid { grid-template-columns: 1fr 1fr; } .catform .wide { grid-column: span 2; }
}
@media (max-width: 640px) {
  .topbar-in { gap: 10px; }
  .search { display: none; }
  .usernav { gap: 10px; }
  h1 { font-size: 1.35rem; }
  .topic-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .tr-stats { justify-content: flex-start; } .stat { flex-direction: row; gap: 4px; min-width: 0; align-items: baseline; }
  .tr-last { margin-left: auto; min-width: 0; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-author { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; }
  .pa-info { flex-direction: row; flex-wrap: wrap; gap: 6px; align-items: center; }
  .avatar { width: 32px; height: 32px; font-size: .85rem; }
  .editor-tabs .hint { display: none; }
  .report-form { right: auto; left: 0; width: min(290px, 85vw); }
}
