/* Scoped ecosystem map. All labels remain HTML and all colors follow the site palette. */
#ekosistem { scroll-margin-top: 6rem; }
.prose > .motor-map-wrap {
  width: min(100vw - 2.5rem, 1120px);
  margin: 2rem calc(50% - min(50vw - 1.25rem, 560px));
}
.bm-map {
  --bm-line: color-mix(in srgb, var(--brand) 25%, var(--border));
  border: 1px solid var(--bm-line);
  border-radius: 24px;
  padding: clamp(1rem, 2.3vw, 1.75rem);
  background:
    radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%),
    var(--surface);
  box-shadow: 0 18px 48px color-mix(in srgb, var(--text) 5%, transparent);
}
.bm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 36px; margin-bottom: 1.25rem; }
.bm-caption, .bm-core-label { font: 600 .66rem/1.5 var(--font-mono); letter-spacing: .09em; color: var(--brand-strong); }
.bm-motion {
  flex: none; font-family: inherit; font-size: .73rem; font-weight: 500; line-height: 1.4; padding: .5rem .7rem; min-height: 36px;
  border: 1px solid var(--bm-line); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.bm-motion[hidden] { display: none; }
.bm-motion:hover { color: var(--brand-strong); border-color: var(--brand); }
.bm-core {
  position: relative; width: fit-content; max-width: 100%; margin-inline: auto;
  display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.5rem;
  background: var(--surface); border: 1px solid var(--bm-line); border-radius: 18px;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 8%, transparent);
}
.bm-core::after { content: ""; position: absolute; bottom: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 12%, transparent); }
.bm-core-emblem { flex: none; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; color: #fff; background: linear-gradient(145deg, var(--accent), var(--accent-strong)); }
.bm-core-emblem .bm-icon { width: 32px; height: 32px; }
.bm-core h3 { margin: .15rem 0 .3rem; font-size: 1.4rem; letter-spacing: -.035em; }
.bm-core p { margin: 0; }
.bm-core-meta { font-size: .8rem; color: var(--text-muted); }
.bm-core-tag { border-left: 1px solid var(--border); padding-left: 1.2rem; margin-left: .4rem; max-width: 12ch; font-size: .75rem; line-height: 1.6; color: var(--text-muted); }
.bm-icon { display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.bm-wires { display: block; width: calc(100% + 12px); margin-inline: -6px; height: 64px; overflow: visible; }
.bm-wire, .bm-signal { fill: none; stroke: var(--bm-line); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.bm-signal { stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 5 95; animation: bm-flow 4s linear infinite; animation-play-state: paused; opacity: 0; }
.bm-wires g:nth-child(2) .bm-signal { animation-delay: -1s; }
.bm-wires g:nth-child(3) .bm-signal { animation-delay: -2s; }
.bm-wires g:nth-child(4) .bm-signal { animation-delay: -3s; }
.bm-map[data-motion="on"] .bm-signal { opacity: .8; animation-play-state: running; }
@keyframes bm-flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.bm-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bm-map .bm-group {
  min-width: 0; position: relative; display: flex; flex-direction: column;
  padding: 1rem .85rem .85rem; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease;
}
.bm-group::before { content: ""; position: absolute; left: calc(50% - 4px); top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.bm-group:hover, .bm-group:focus-within { border-color: var(--brand); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 9%, transparent); }
.bm-group-head { display: flex; align-items: flex-start; gap: .6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.bm-group-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; color: var(--brand-strong); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.bm-group-icon .bm-icon { width: 19px; height: 19px; }
.bm-group-head h3 { margin: 0 0 .3rem; font-size: 1rem; letter-spacing: -.02em; line-height: 1.3; }
.bm-group-head p { margin: 0; font-size: .7rem; line-height: 1.5; color: var(--text-muted); }
.bm-count { flex: none; margin-left: auto; font: 600 .7rem/1.8 var(--font-mono); text-align: center; min-width: 22px; color: var(--brand-strong); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border-radius: 6px; }
.bm-map .bm-items { list-style: none; padding: .55rem 0; margin: 0 0 auto; }
.bm-items li + li { border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.bm-leaf, .bm-items a { display: flex; align-items: flex-start; gap: .55rem; padding: .7rem .15rem; }
.bm-items .bm-icon { width: 17px; height: 17px; margin-top: .15rem; color: var(--brand-strong); }
.bm-items strong { display: block; font-size: .78rem; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.bm-items small { display: block; margin-top: .2rem; color: var(--text-muted); font-size: .7rem; line-height: 1.55; }
.bm-items a { min-height: 44px; color: var(--text); border-radius: 8px; text-decoration: none; }
.bm-items a:hover { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); color: var(--brand-strong); }
.bm-arrow { color: var(--brand-strong); margin-left: auto; font-size: .8rem; }
.bm-more, .bm-note { margin: .6rem 0 0; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .73rem; line-height: 1.5; }
.bm-more { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; color: var(--brand-strong); font-weight: 600; text-decoration: none; }
.bm-more:hover { text-decoration: underline; }
.bm-note { color: var(--text-muted); }
.bm-map:has([data-group="parametreler"]:is(:hover,:focus-within)) [data-wire="parametreler"] .bm-wire,
.bm-map:has([data-group="hesaplar"]:is(:hover,:focus-within)) [data-wire="hesaplar"] .bm-wire,
.bm-map:has([data-group="araclar"]:is(:hover,:focus-within)) [data-wire="araclar"] .bm-wire,
.bm-map:has([data-group="denetim"]:is(:hover,:focus-within)) [data-wire="denetim"] .bm-wire { stroke: var(--brand); stroke-width: 2.5; }
@media (max-width: 1000px) {
  #ekosistem { scroll-margin-top: 10rem; }
  .site-header .header-inner { flex-wrap: wrap; }
  .site-header .site-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .site-header .site-nav ul { width: max-content; }
  .site-header .site-nav a { white-space: nowrap; }
  .site-header .palette { margin-left: auto; }
  .bm-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
  .bm-wires { display: none; }
  .bm-groups { margin-top: 2rem; }
  .bm-map .bm-group { border-top: 2px solid var(--bm-line); }
  .bm-group::before { top: -5px; }
  .bm-items strong { font-size: .88rem; }
  .bm-items small, .bm-group-head p { font-size: .78rem; }
  .bm-core::after { animation: bm-port 3s ease-in-out infinite; animation-play-state: paused; }
  .bm-map[data-motion="on"] .bm-core::after { animation-play-state: running; }
  @keyframes bm-port { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--brand) 5%, transparent); } }
}
@media (max-width: 560px) {
  .bm-map { border-radius: 18px; }
  .bm-toolbar { align-items: flex-start; gap: .5rem; }
  .bm-caption { max-width: 22ch; font-size: .6rem; }
  .bm-core { width: 100%; padding: 1rem; gap: .75rem; }
  .bm-core h3 { font-size: 1.2rem; }
  .bm-core-emblem { width: 44px; height: 44px; border-radius: 12px; }
  .bm-core-tag { display: none; }
  .bm-groups { grid-template-columns: minmax(0, 1fr); padding-left: 14px; border-left: 1px solid var(--bm-line); }
  .bm-group::before { top: 24px; left: -19px; }
  .bm-map .bm-group { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-map .bm-signal, .bm-map .bm-core::after { animation: none; }
  .bm-map .bm-group { transition: none; }
}
@media print {
  .prose > .motor-map-wrap { width: 100%; margin-inline: 0; }
  .bm-map { padding: 0; border: 0; background: none; box-shadow: none; }
  .bm-motion, .bm-wires { display: none; }
  .bm-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-map .bm-group { break-inside: avoid; box-shadow: none; }
  .bm-signal, .bm-core::after { animation: none !important; }
}
