:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-code: #f3f4f6;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --border: #d1d9e0;
  --accent: #0b63ce;
  --accent-soft: #ddf4ff;
  --warn-bg: #fff8c5;
  --warn-border: #d4a72c;
  --radius: 8px;
  --sidebar-w: 270px;
  --toc-w: 220px;
  --top-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --bg-soft: #151b23; --bg-code: #1b222c; --fg: #e6edf3; --fg-muted: #9198a1;
    --border: #30363d; --accent: #4493f8; --accent-soft: #12263f; --warn-bg: #2b2411; --warn-border: #9e6a03;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-soft: #151b23; --bg-code: #1b222c; --fg: #e6edf3; --fg-muted: #9198a1;
  --border: #30363d; --accent: #4493f8; --accent-soft: #12263f; --warn-bg: #2b2411; --warn-border: #9e6a03;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--bg); padding: 6px 10px; }

/* üst çubuk */
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 650; white-space: nowrap; }
.brand svg { color: var(--accent); }
.brand:hover { text-decoration: none; }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--bg); }
#results { position: absolute; top: 40px; left: 0; right: 0; max-height: 70vh; overflow: auto; margin: 0; padding: 4px;
  list-style: none; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
#results li a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--fg); }
#results li a:hover, #results li[aria-selected="true"] a { background: var(--accent-soft); text-decoration: none; }
#results .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-muted); margin-right: 6px; }
#results .d { display: block; font-size: 12.5px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#results .empty { padding: 8px 10px; color: var(--fg-muted); font-size: 14px; }
.menu-btn, .theme-btn { border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg); border-radius: var(--radius);
  height: 36px; min-width: 36px; font-size: 16px; cursor: pointer; }
.menu-btn { display: none; }

/* yerleşim */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow: auto; padding: 16px 12px 40px;
  border-right: 1px solid var(--border); font-size: 14.5px; }
.nav-sec summary { cursor: pointer; font-weight: 650; padding: 6px 8px; list-style: none; color: var(--fg); }
.nav-sec summary::-webkit-details-marker { display: none; }
.nav-sec summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--fg-muted); transition: transform .15s; }
.nav-sec[open] summary::before { transform: rotate(90deg); }
.nav-sec ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 14px; }
.nav-sec a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--fg-muted); }
.nav-sec a:hover { background: var(--bg-soft); color: var(--fg); text-decoration: none; }
.nav-sec a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.content { padding: 24px 40px 64px; min-width: 0; }
.crumbs { font-size: 13.5px; color: var(--fg-muted); margin-bottom: 8px; }
.crumbs span { margin: 0 4px; }
.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow: auto; padding: 24px 16px; font-size: 13.5px; }
.toc-title { font-weight: 650; margin-bottom: 6px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { padding: 3px 0; }
.toc li.l3 { padding-left: 12px; }
.toc a { color: var(--fg-muted); }
.toc a.active { color: var(--accent); font-weight: 600; }

/* içerik tipografisi */
article { max-width: 920px; }
article h1 { font-size: 2rem; line-height: 1.25; margin: 0 0 16px; }
article h2 { font-size: 1.45rem; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
article h3 { font-size: 1.15rem; margin: 28px 0 8px; }
article h4 { font-size: 1rem; margin: 20px 0 6px; }
article h1 .anchor, article h2 .anchor, article h3 .anchor, article h4 .anchor { float: left; margin-left: -20px; width: 20px; color: var(--fg-muted); opacity: 0; font-weight: 400; }
article h1:hover .anchor, article h2:hover .anchor, article h3:hover .anchor, article h4:hover .anchor { opacity: 1; text-decoration: none; }
article p, article ul, article ol { margin: 0 0 14px; }
article li + li { margin-top: 4px; }
article blockquote { margin: 0 0 16px; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0; color: var(--fg); }
article blockquote p:last-child { margin-bottom: 0; }
article code { font-family: var(--mono); font-size: .875em; background: var(--bg-code); padding: .15em .35em; border-radius: 5px; }
article pre { margin: 0 0 16px; padding: 14px 16px; overflow: auto; background: var(--bg-code); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13.5px; line-height: 1.55; position: relative; }
article pre code { background: none; padding: 0; font-size: inherit; }
article pre code.hljs { background: none; padding: 0; }
article a.tbl code { color: var(--accent); }
article hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
article small { color: var(--fg-muted); }
article details { margin: 0 0 16px; }
article details summary { cursor: pointer; color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius); }
article table { border-collapse: collapse; width: 100%; font-size: 14px; }
article th, article td { padding: 7px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
article th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
article tr:last-child td { border-bottom: 0; }
article td code { white-space: nowrap; }
.copy-btn { position: absolute; top: 6px; right: 6px; font: 12px var(--font); padding: 2px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg); color: var(--fg-muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.filter { width: 100%; max-width: 420px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; }

/* kartlar (ana sayfa) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 24px; }
.card { display: block; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); color: var(--fg); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card strong { display: block; color: var(--accent); margin-bottom: 4px; }
.card span { font-size: 14px; color: var(--fg-muted); }

.page-foot { max-width: 920px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--fg-muted); }

@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-block; }
  .brand span { display: none; }
  .sidebar { position: fixed; z-index: 30; top: var(--top-h); left: 0; width: min(86vw, 320px); background: var(--bg);
    transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 24px rgba(0,0,0,.25); }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 16px 16px 48px; }
  article h1 { font-size: 1.6rem; }
  article h1 .anchor, article h2 .anchor, article h3 .anchor, article h4 .anchor { display: none; }
}
