/* sysgraph dokümantasyonu. Renkler ve yazı tipi tanıtım sayfasıyla aynı; açık ve koyu tema <html data-theme> ile. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --bg: #ffffff; --bg-2: #f6f7fa; --panel: #ffffff; --panel-2: #f6f7fa; --panel-3: #eceff4;
  --border: #e6e8ee; --border-strong: #cfd4de;
  --text: #171b26; --text-2: #444b5c; --muted: #7a8295;
  --accent: #5466ff; --accent-2: #7b5cff; --accent-soft: rgba(84, 102, 255, .09); --accent-ring: rgba(84, 102, 255, .28);
  --ok: #1f9d6a; --danger: #e5484d; --warn: #c27a06; --tip: #7b5cff;
  --code-bg: #f6f7fa; --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -8px rgba(16, 24, 40, .14);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12; --bg-2: #0f1218; --panel: #12151c; --panel-2: #171b24; --panel-3: #1e2330;
  --border: #222836; --border-strong: #313949;
  --text: #e7eaf1; --text-2: #b9c0cf; --muted: #7e879a;
  --accent: #7c8cff; --accent-2: #a28bff; --accent-soft: rgba(124, 140, 255, .12); --accent-ring: rgba(124, 140, 255, .35);
  --ok: #3dd68c; --danger: #ff6369; --warn: #f5a524; --tip: #a28bff;
  --code-bg: #12151c; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -10px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.7; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.ic { width: 18px; height: 18px; flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-ring); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--panel); padding: 6px 10px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Üst bar ---------- */
.d-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
.d-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none !important; flex: none; }
.d-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.d-mark .ic { width: 18px; height: 18px; stroke-width: 2.1; }
.d-name { font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.d-name b { font-weight: 750; }
.d-docs { color: var(--text-2); font-weight: 650; font-size: 14px; padding-left: 14px; border-left: 1px solid var(--border); }
.d-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 460px; margin: 0 auto; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.d-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.d-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--text); }
.d-search input::-webkit-search-cancel-button { display: none; }
kbd, .d-key { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--panel); color: var(--text-2); white-space: nowrap; }
.d-results { position: absolute; top: 44px; left: 0; right: 0; max-height: min(70vh, 520px); overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.d-results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none !important; }
.d-results a:hover, .d-results a.sel { background: var(--accent-soft); }
.d-results small { display: block; color: var(--muted); font-size: 12px; }
.d-results .snip { display: block; color: var(--text-2); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.d-results mark { background: none; color: var(--accent); font-weight: 650; }
.d-results .empty { padding: 10px; color: var(--muted); font-size: 14px; }
.d-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.d-icon { display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: none; color: var(--text-2); cursor: pointer; text-decoration: none !important; font-weight: 700; font-size: 12px; }
.d-icon:hover { background: var(--panel-3); color: var(--text); }
.d-theme .sun { display: none; }
[data-theme="dark"] .d-theme .sun { display: block; }
[data-theme="dark"] .d-theme .moon { display: none; }
.d-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 9px; color: #fff; font-weight: 650; font-size: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); text-decoration: none !important; white-space: nowrap; }
.menu-btn { display: none; }

/* ---------- Düzen ---------- */
.d-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); max-width: 1440px; margin: 0 auto; }
.d-side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--border); }
.nav-sec { margin-bottom: 18px; }
.nav-title { font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 10px 6px; }
.d-side ul { list-style: none; margin: 0; padding: 0; }
.d-side li a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.45; text-decoration: none !important; }
.d-side li a:hover { background: var(--panel-3); color: var(--text); }
.d-side li a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.d-main { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; padding: 36px 40px 80px; }
.d-article { min-width: 0; max-width: 780px; }
.d-toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; font-size: 13.5px; }
.toc-title { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.d-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.d-toc li a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-2); line-height: 1.4; text-decoration: none !important; }
.d-toc li.t3 a { padding-left: 24px; font-size: 13px; }
.d-toc li a:hover { color: var(--text); }
.d-toc li a.on { color: var(--accent); border-left-color: var(--accent); }

/* ---------- İçerik ---------- */
.d-crumb { font-size: 13px; font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.d-article h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; }
.d-article h2 { font-size: 23px; letter-spacing: -.01em; margin: 44px 0 10px; padding-top: 6px; border-top: 1px solid var(--border); }
.d-article h3 { font-size: 18px; margin: 30px 0 8px; }
.d-article h4 { font-size: 16px; margin: 22px 0 6px; }
.d-article h2 .anchor, .d-article h3 .anchor, .d-article h4 .anchor { float: left; margin-left: -22px; width: 22px; color: var(--muted); opacity: 0; text-decoration: none !important; font-weight: 500; }
.d-article h2:hover .anchor, .d-article h3:hover .anchor, .d-article h4:hover .anchor { opacity: 1; }
.d-article p, .d-article li { color: var(--text-2); }
.d-article strong { color: var(--text); }
.d-article ul, .d-article ol { padding-left: 22px; }
.d-article li { margin: 4px 0; }
.d-article > p:first-of-type { font-size: 17.5px; color: var(--text-2); }
.d-article code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 5px; background: var(--code-bg); border: 1px solid var(--border); }
.d-article .code { position: relative; margin: 14px 0; }
.d-article pre { margin: 0; padding: 14px 16px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg); font-size: 13.5px; line-height: 1.6; }
.d-article pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel); color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus-visible { opacity: 1; }
.copy.done { color: var(--ok); }
.table { overflow: auto; margin: 14px 0; border: 1px solid var(--border); border-radius: 10px; }
.d-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.d-article th, .d-article td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.d-article th { background: var(--panel-2); font-weight: 650; color: var(--text); }
.d-article tr:last-child td { border-bottom: 0; }
.d-article td { color: var(--text-2); }
blockquote { margin: 14px 0; padding: 2px 16px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.callout { margin: 18px 0; padding: 12px 16px; border: 1px solid; border-radius: 10px; }
.callout p { margin: 4px 0; }
.callout-head { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.callout-head .ic { width: 16px; height: 16px; }
.c-note { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.c-note .callout-head { color: var(--accent); }
.c-tip { border-color: color-mix(in srgb, var(--tip) 35%, transparent); background: color-mix(in srgb, var(--tip) 7%, transparent); }
.c-tip .callout-head { color: var(--tip); }
.c-warning { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.c-warning .callout-head { color: var(--warn); }
.c-important { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.c-important .callout-head { color: var(--danger); }
.shot { margin: 20px 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.shot figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.ext { display: inline-block; width: 13px; height: 13px; margin-left: 3px; vertical-align: -1px; }
.d-article hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 18px 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none !important; }
.cards a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cards b { display: block; margin-bottom: 2px; }
.cards span { display: block; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.d-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.d-pager a { display: block; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none !important; }
.d-pager a:hover { border-color: var(--accent); }
.d-pager a.next { text-align: right; }
.d-pager small { display: block; color: var(--muted); font-size: 12.5px; }
.d-pager span { font-weight: 650; }
.d-foot { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
.d-foot a { color: var(--muted); }

/* ---------- Dar ekranlar ---------- */
@media (max-width: 1180px) { .d-main { grid-template-columns: minmax(0, 1fr); } .d-toc { display: none; } }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .d-docs, .d-key, .d-btn { display: none; }
  .d-head { gap: 8px; padding: 0 12px; }
  .d-body { grid-template-columns: minmax(0, 1fr); }
  .d-side { position: fixed; top: 64px; left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 25; background: var(--bg); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .d-side { transform: none; }
  .d-main { padding: 24px 18px 60px; }
  .d-article h1 { font-size: 28px; }
}
@media (max-width: 520px) { .d-name { display: none; } }
@media print { .d-head, .d-side, .d-toc, .d-pager, .d-foot { display: none; } .d-body, .d-main { display: block; padding: 0; } }
