/* =====================================================================
   Ürün ve Ticari Strateji — öğrenme bölümü bileşenleri
   Yalnız tr/urun-ticari/ altındaki sayfalarda yüklenir. Renkler main.css
   değişkenlerinden gelir (--fg, --muted, --line, --blue, --panel …), böylece
   açık ve koyu temada kendiliğinden uyum sağlar.
   ===================================================================== */

/* ---------- seviye rozeti: dolu nokta sayısı seviyeyi renge bağlı kalmadan gösterir */
.st-level { display: inline-flex; align-items: center; gap: 8px; padding: 2px 11px 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--fg); font-size: .8rem; font-weight: 700; line-height: 1.75; white-space: nowrap; }
.st-dots { display: inline-flex; gap: 3px; }
.st-dots b { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--blue); }
.st-level[data-l="1"] .st-dots b:first-child,
.st-level[data-l="2"] .st-dots b:nth-child(-n+2),
.st-level[data-l="3"] .st-dots b { background: var(--blue); }

/* ---------- ders sayfası üst bilgisi */
.article .st-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: -14px 0 26px; color: var(--muted); font-size: .92rem; }
.article .st-lead { font-size: 1.14rem; line-height: 1.75; color: var(--muted); max-width: var(--measure); }
.article h1 { line-height: 1.12; }
.article h2 { scroll-margin-top: 96px; }
.article blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--line); color: var(--muted); max-width: var(--measure); }
.article ul, .article ol { padding-left: 1.3em; }
.article li + li { margin-top: .35em; }
.article .kavram > ul:last-child, .article .kavram > ol:last-child { margin-bottom: 0; }
.article .checklist li + li { margin-top: 0; }
.article dfn { font-style: normal; font-weight: 700; }
.article .en { color: var(--muted); font-size: .92em; font-style: italic; }
.article table caption { caption-side: top; text-align: left; padding: 0 0 8px; color: var(--muted); font-size: .88rem; }
.article .table-wrap > table > caption { padding: 12px 12px 8px; }
.article table.st-score thead th { white-space: normal; vertical-align: bottom; }
.article table.st-score td:first-child { min-width: 10em; }
@media (max-width: 600px) {
  .article table thead th, .article table thead th.num { white-space: normal; }
  .article .table-wrap table:not(.st-tight) td:first-child { min-width: 8.5em; }
}
.article table td.num, .article table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.article .table-note { margin-top: -0.8em; color: var(--muted); font-size: .86rem; }
.article .table-wrap:not(:last-child) { margin-bottom: 1.1em; }
.article .table-wrap + .table-note { margin-top: -0.55em; }
.article .k-label { margin-bottom: 10px; }

/* iki sütunlu kavram kartları (makale içi) */
.st-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 1.4em 0; padding: 0; list-style: none; }
.st-cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article .st-cards > li { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); max-width: none; }
.st-cards h3, .st-cards h4 { margin: 0 0 6px; font-size: 1.02rem; }
.st-cards p { margin: 0; color: var(--muted); font-size: .95rem; }
.st-cards .tag-n { display: block; margin-bottom: 4px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .02em; }

/* zincir / basamak listesi (ör. seçimler zinciri) */
.st-chain { counter-reset: ch; display: grid; gap: 10px; margin: 1.4em 0; padding: 0; list-style: none; }
.article .st-chain > li { counter-increment: ch; position: relative; margin: 0; padding: 14px 18px 14px 58px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); max-width: none; }
.st-chain > li::before { content: counter(ch); position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 800; font-size: .9rem; }
[data-theme="dark"] .st-chain > li::before { color: #0f141b; }
.st-chain > li strong { display: block; }
.st-chain > li span { color: var(--muted); font-size: .95rem; }

/* ---------- şekiller (satır içi SVG) */
.st-fig { margin: 1.8em 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.st-fig svg { display: block; width: 100%; height: auto; max-width: 760px; margin-inline: auto; font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
.st-fig .sx { overflow-x: auto; overscroll-behavior-x: contain; }
.st-fig .sx > svg { min-width: var(--minw, 0); }
.st-fig figcaption { margin-top: 12px; color: var(--muted); font-size: .88rem; line-height: 1.6; max-width: 80ch; }
.st-fig .tx { fill: var(--fg); }
.st-fig .mu { fill: var(--muted); }
.st-fig .ac { fill: var(--blue); }
.st-fig .acs { stroke: var(--blue); }
.st-fig .sf { fill: var(--blue-soft); }
.st-fig .pn { fill: var(--panel); }
.st-fig .pp { fill: var(--paper); }
.st-fig .ln { stroke: var(--line); }
.st-fig .fgs { stroke: var(--fg); }
.st-fig .mus { stroke: var(--muted); }
.st-fig .ye { fill: var(--yellow, #ffd600); }
.st-fig .ok { fill: #1f8a5b; }
[data-theme="dark"] .st-fig .ok { fill: #5cc79a; }
.st-fig .bad { fill: #c2410c; }
[data-theme="dark"] .st-fig .bad { fill: #f08a5d; }
.st-fig text { font-size: 13px; }
.st-fig .sm { font-size: 11.5px; }
.st-fig .lg { font-size: 15px; font-weight: 700; }
.st-fig .b { font-weight: 700; }

/* ---------- hesaplayıcı */
.st-calc { margin: 2em 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.st-calc-head { padding: 18px 20px 6px; }
.st-calc-head h3 { margin: 4px 0 6px; font-size: 1.18rem; }
.st-calc-head p { margin: 0; color: var(--muted); font-size: .95rem; max-width: 70ch; }
.st-calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; padding: 14px 20px 18px; }
.st-calc label { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; color: var(--fg); }
.st-calc label small { font-weight: 400; color: var(--muted); }
.st-calc input, .st-calc select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--fg); font: inherit; font-size: 1rem; font-variant-numeric: tabular-nums; }
.st-calc input:focus-visible, .st-calc select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.st-calc input[aria-invalid="true"] { border-color: #c2410c; }
.st-calc input[type="range"] { min-height: 32px; padding: 0; border: 0; background: transparent; accent-color: var(--blue); }
.st-calc fieldset { grid-column: 1 / -1; margin: 0; padding: 12px 14px 14px; border: 1px dashed var(--line); border-radius: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.st-calc legend { padding: 0 6px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.st-out { display: flex; flex-wrap: wrap; margin: 0; border-top: 1px solid var(--line); background: var(--paper); }
.st-out > div { flex: 1 1 170px; padding: 14px 20px; background: var(--paper); box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.st-out dt { color: var(--muted); font-size: .82rem; font-weight: 600; }
.st-out dd { margin: 2px 0 0; font-size: 1.32rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--fg); line-height: 1.3; overflow-wrap: anywhere; }
.st-out dd[data-state="ok"] { color: #1f7a52; }
.st-out dd[data-state="warn"] { color: #a15c00; }
.st-out dd[data-state="bad"] { color: #b42318; }
[data-theme="dark"] .st-out dd[data-state="ok"] { color: #5cc79a; }
[data-theme="dark"] .st-out dd[data-state="warn"] { color: #f2b766; }
[data-theme="dark"] .st-out dd[data-state="bad"] { color: #f4876e; }
.article .st-calc p.st-calc-msg, .article .st-calc p.st-calc-note, .article .st-calc-head p { max-width: none; }
.st-calc-msg { margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: .92rem; min-height: 1.5em; }
.st-calc-note { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; line-height: 1.6; }
.st-bar { position: relative; height: 34px; margin: 2px 20px 0; border-radius: 6px; overflow: hidden; display: flex; background: var(--paper); border: 1px solid var(--line); }
.st-bar span { display: block; height: 100%; }
.st-bar .seg-ref { background: color-mix(in srgb, var(--muted) 28%, var(--paper)); }
.st-bar .seg-plus { background: color-mix(in srgb, var(--blue) 45%, var(--paper)); }
.st-bar .mark { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--fg); }
.st-bar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 20px 14px; color: var(--muted); font-size: .82rem; }
.st-bar-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- kendini sına */
.st-quiz details { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.st-quiz summary { padding: 14px 18px; cursor: pointer; font-weight: 700; line-height: 1.55; }
.st-quiz summary::marker { color: var(--blue); }
.st-quiz details[open] summary { border-bottom: 1px solid var(--line); }
.st-quiz details > div { padding: 12px 18px 16px; color: var(--muted); }
.st-quiz details > div p { margin: 0 0 .6em; }
.st-quiz details > div p:last-child { margin-bottom: 0; }

/* ---------- kaynaklar listesi */
.st-refs { margin: 1em 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.article .st-refs > li { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); max-width: none; font-size: .95rem; line-height: 1.65; scroll-margin-top: 96px; }
.st-refs > li:target { background: var(--blue-soft); }
.st-refs .st-type { margin-right: 8px; }
.st-refs cite { font-style: italic; }
.st-refs .why { display: block; margin-top: 2px; color: var(--muted); font-size: .9rem; }
.st-type { display: inline-block; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .74rem; font-weight: 700; line-height: 1.7; vertical-align: 1px; white-space: nowrap; }
.st-type.free { color: #1f7a52; border-color: color-mix(in srgb, #1f7a52 40%, var(--line)); }
[data-theme="dark"] .st-type.free { color: #5cc79a; }
a.cite { text-decoration: none; border-bottom: 1px dotted currentColor; }

/* ---------- önceki / sonraki ders */
.st-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 3em 0 0; padding-top: 1.6em; border-top: 1px solid var(--line); }
.st-pager a { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); text-decoration: none; background: var(--paper); }
.st-pager a:hover { border-color: var(--blue); background: var(--blue-soft); }
.st-pager small { color: var(--muted); font-size: .82rem; }
.st-pager b { font-size: 1rem; }
.st-pager .next { text-align: right; grid-column: 2; }

/* ---------- ana sayfa: öğrenme yolu */
.st-path { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.st-stage { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.st-stage > header { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); background: var(--panel); }
.st-stage > header h3 { margin: 14px 0 6px; font-size: 1.28rem; line-height: 1.3; }
.st-stage > header p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.st-lessons { margin: 0; padding: 0; list-style: none; }
.st-lessons li + li { border-top: 1px solid var(--line); }
.st-lessons a { display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 2px 8px; padding: 14px 22px 15px; color: var(--fg); text-decoration: none; transition: background .2s ease; }
.st-lessons a:hover, .st-lessons a:focus-visible { background: var(--blue-soft); }
.st-lessons .n { grid-row: span 3; color: var(--blue); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.55; }
.st-lessons .t { font-weight: 700; line-height: 1.45; }
.st-lessons .d { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.st-lessons .m { color: var(--faint); font-size: .8rem; }

/* ana sayfa: analiz akışı */
.st-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: fl; }
.st-flow > li { counter-increment: fl; display: flex; flex-direction: column; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.st-flow > li::before { content: counter(fl, decimal-leading-zero); color: var(--blue); font-weight: 800; font-size: .9rem; }
.st-flow h3 { margin: 6px 0 6px; font-size: 1.05rem; line-height: 1.35; }
.st-flow p { margin: 0 0 12px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.st-flow .go { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.st-flow .go a { padding: 2px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: .8rem; font-weight: 700; text-decoration: none; color: var(--blue); }
.st-flow .go a:hover { border-color: var(--blue); background: var(--blue-soft); }

/* ana sayfa: başlangıç rafı */
.st-shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.st-shelf > li { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.st-shelf .why { margin: 6px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.st-shelf h3 { margin: 8px 0 2px; font-size: 1.02rem; line-height: 1.35; }
.st-shelf .by { color: var(--muted); font-size: .85rem; }

/* ---------- kütüphane */
.st-lib-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.st-lib-tools .filter-row { margin-bottom: 0; }
.st-lib-count { color: var(--muted); font-size: .9rem; }
.st-lib { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.st-lib > li { display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); scroll-margin-top: 96px; }
.st-lib > li:target { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.st-lib .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.st-lib h3 { margin: 10px 0 2px; font-size: 1.08rem; line-height: 1.35; }
.st-lib h3 a { color: var(--fg); text-decoration: none; }
.st-lib h3 a:hover { color: var(--blue); text-decoration: underline; }
.st-lib .by { margin: 0 0 8px; color: var(--muted); font-size: .88rem; }
.st-lib .why { margin: 0; font-size: .95rem; line-height: 1.6; }
.st-lib .tr { margin: 8px 0 0; color: var(--muted); font-size: .86rem; }
.st-lib .in { margin: 8px 0 0; font-size: .84rem; color: var(--muted); }
.st-lib .in a { font-weight: 600; }
.st-topic { color: var(--muted); font-size: .8rem; }
.st-paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.st-paths > li { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.st-paths h3 { margin: 0 0 4px; font-size: 1.08rem; }
.st-paths p { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.st-paths ol { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.st-paths ol li + li { margin-top: 4px; }

/* kütüphane: Türkiye veri kaynakları */
.st-data > div { grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); }
.st-data dt { font-size: .98rem; font-weight: 700; line-height: 1.45; color: var(--fg); }
.st-data dd { max-width: 75ch; }

/* ---------- sözlük */
.st-gloss-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 14px; }
.st-gloss-tools input { flex: 1 1 260px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--fg); font: inherit; }
.st-gloss-tools input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.st-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.st-letters a { display: grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; text-decoration: none; color: var(--blue); }
.st-letters a:hover { background: var(--blue-soft); }
.st-gloss-group h2 { font-size: 1.5rem; margin: 1.4em 0 .4em; padding-top: .4em; }
.st-gloss { margin: 0; }
.st-gloss > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 6px 24px; padding: 12px 0; border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.st-gloss > div:target { background: var(--blue-soft); }
.st-gloss dt { font-weight: 700; line-height: 1.45; }
.st-gloss dt .en { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; font-style: italic; }
.st-gloss dd { margin: 0; color: var(--fg); font-size: .97rem; line-height: 1.65; max-width: 72ch; }
.st-gloss dd a.l { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.st-gloss > div.is-hidden, .st-gloss-group.is-hidden { display: none; }

/* ---------- uyarı / not bandı (ana sayfa ve kütüphane) */
.st-note { padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; background: var(--panel); color: var(--muted); font-size: .95rem; max-width: 80ch; }
.st-note strong { color: var(--fg); }

/* ---------- duyarlı düzen */
@media (max-width: 1100px) {
  .st-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .st-path { grid-template-columns: 1fr; }
  .st-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-lib, .st-paths { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .st-cards, .st-cards.three { grid-template-columns: 1fr; }
  .st-shelf { grid-template-columns: 1fr; }
  .st-data > div { grid-template-columns: 1fr; }
  .st-gloss > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 620px) {
  .st-flow { grid-template-columns: 1fr; }
  .st-pager { grid-template-columns: 1fr; }
  .st-pager .next { grid-column: 1; }
  .st-fig { padding: 12px 10px; }
  .st-calc-grid, .st-calc fieldset { grid-template-columns: 1fr; }
  .st-out > div { flex: 1 1 45%; padding: 12px 16px; }
  .st-out dd { font-size: 1.12rem; }
  .article .st-meta { margin-top: -8px; }
  .article .st-chain > li { padding-left: 52px; }
  .st-lessons a { padding-inline: 18px; }
}
@media print {
  .st-calc input { border: 0; padding: 0; min-height: 0; }
  .st-pager, .st-lib-tools, .st-gloss-tools, .st-letters { display: none; }
  .st-quiz details { break-inside: avoid; }
}
