/* Sciestro Certainty — modül teması. Temel düzen /design/design.css (dx-* sınıfları) ile ortak; burada yalnız Certainty'ye özgü parçalar.
   Renkler tokenlardan. TEK İSTİSNA: bulguların özeti / kanıt profili tabloları, kullanıcının isteğiyle (2026-11-18) alışılmış tablo
   görünümünde (açık gri-mavi başlık, kesinlik düzeyine göre renk); paleti --gr-* değişkenlerinde, aynı değerler Word çıktısında
   (server/certainty/export.js). */

:root {
  --gr-line: #7F95AA; /* brand-check: izinli (bulguların özeti tablosu paleti, kullanıcı isteği) */
  --gr-head: #D6E2EE; /* brand-check: izinli (bulguların özeti tablosu paleti, kullanıcı isteği) */
  --gr-sub: #E9F0F7; /* brand-check: izinli (bulguların özeti tablosu paleti, kullanıcı isteği) */
  --gr-row: #F1F4F7; /* brand-check: izinli (bulguların özeti tablosu paleti, kullanıcı isteği) */
  --gr-high: #1E6B30; --gr-high-bg: #DDF1E1; /* brand-check: izinli (kesinlik düzeyi renkleri, kullanıcı isteği) */
  --gr-mod: #4B6B12; --gr-mod-bg: #ECF4D6; /* brand-check: izinli (kesinlik düzeyi renkleri, kullanıcı isteği) */
  --gr-low: #8A5A00; --gr-low-bg: #FFF1CC; /* brand-check: izinli (kesinlik düzeyi renkleri, kullanıcı isteği) */
  --gr-vlow: #A12A1B; --gr-vlow-bg: #FBE3DF; /* brand-check: izinli (kesinlik düzeyi renkleri, kullanıcı isteği) */
  --gr-crit: #7A1F1F; /* brand-check: izinli (önem: kritik, kullanıcı isteği) */
}

/* ---------- genel ---------- */
.cx-hint { font-size: var(--fs-small); color: var(--ink-secondary); margin: 2px 0 var(--space-3); }
.cx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); }
.cx-grid .dx-f { margin-top: var(--space-2); }
.cx-span2 { grid-column: span 2; } .cx-span4 { grid-column: 1 / -1; }
.cx-app select.sc-input { height: 38px; }
.cx-head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; justify-content: space-between; }
.cx-head h3 { margin: 0; }
.cx-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cx-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; border-radius: var(--radius-pill); padding: 2px 9px; background: var(--layer-inset); color: var(--ink-secondary); border: 1px solid var(--line); }
.cx-chip.crit { color: var(--gr-crit); border-color: currentColor; }
.cx-chip.ai { background: var(--accent-50); color: var(--accent-700); border-color: var(--accent-300); }
.cx-prev { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--layer-inset); border: 1px solid var(--layer-inset-line); border-radius: var(--radius-md); font-size: var(--fs-small); display: grid; gap: 2px; }
.cx-prev b { color: var(--ink); }
.cx-auto { border: 2px solid var(--accent-300); background: var(--accent-50); }
.cx-auto h3 { color: var(--accent-700); }
.cx-auto ol { margin: var(--space-2) 0 0; padding-left: 20px; font-size: var(--fs-small); }
.cx-ev { display: grid; gap: 6px; margin-bottom: var(--space-3); }
.cx-evrow { display: flex; align-items: center; gap: var(--space-2); padding: 8px 12px; background: var(--layer-inset); border: 1px solid var(--layer-inset-line); border-radius: var(--radius-md); font-size: var(--fs-small); }
.cx-evrow b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.cx-drop { border: 1.5px dashed var(--accent-300); background: var(--accent-50); border-radius: var(--radius-md); padding: var(--space-4); text-align: center; font-size: var(--fs-small); color: var(--ink-secondary); cursor: pointer; }
.cx-drop.on { border-color: var(--accent-600); }
.cx-x { border: 1px solid var(--line); background: var(--surface); color: var(--ink-secondary); border-radius: var(--radius-sm); width: 28px; height: 28px; cursor: pointer; flex: none; }
.cx-x:hover { color: var(--danger); border-color: var(--danger-line); }

/* kesinlik: alan satırları */
.cx-dom { display: grid; grid-template-columns: 170px 190px minmax(0, 1fr); gap: var(--space-2) var(--space-3); align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.cx-dom:first-of-type { border-top: 0; }
.cx-dom > span { font-weight: 600; font-size: var(--fs-small); color: var(--ink); padding-top: 9px; }
.cx-dom.down select.on { border-color: var(--warning-line); background: var(--warning-bg); }
.cx-dom.up select.on { border-color: var(--success-line); background: var(--success-bg); }
.cx-sub { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent-700); margin: var(--space-3) 0 0; }
.cx-start { font-size: var(--fs-small); color: var(--ink-secondary); }

/* öneriler */
.cx-etd { display: grid; grid-template-columns: minmax(0, 1.1fr) 220px minmax(0, 1.4fr); gap: var(--space-2) var(--space-3); align-items: start; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.cx-etd:first-of-type { border-top: 0; }
.cx-etd > span { font-weight: 600; color: var(--ink); padding-top: 9px; }
.cx-rec { border-left: 5px solid var(--accent-500); }
.cx-rec.sfor, .cx-rec.cfor { border-left-color: var(--success); } .cx-rec.sag, .cx-rec.cag { border-left-color: var(--danger); }
.cx-lvl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--space-2); }
.cx-code { font-family: var(--font-mono); font-weight: 700; font-size: 12px; background: var(--header); color: var(--header-text); border-radius: var(--radius-sm); padding: 2px 7px; }
.cx-legend div { font-size: var(--fs-small); margin-bottom: 6px; }

/* sağ sütun */
.cx-side h3 { font-size: 15px; margin-bottom: var(--space-2); }
.cx-side .gr-cert { font-size: 12px; }
.cx-sumrow { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-small); padding: 4px 0; border-top: 1px solid var(--line); }
.cx-sumrow:first-of-type { border-top: 0; }
.cx-sumrow span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- bulguların özeti tabloları ---------- */
.gr-wrap { margin-bottom: var(--space-4); }
.gr-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink); margin: 0 0 6px; }
.gr-meta { font-size: 12.5px; color: var(--ink-body); margin-bottom: 8px; }
.gr-scroll { overflow-x: auto; }
.gr-table { border-collapse: collapse; width: 100%; font-size: 12.5px; background: var(--surface); color: var(--ink); }
.gr-table th, .gr-table td { border: 1px solid var(--gr-line); padding: 6px 7px; vertical-align: top; text-align: left; }
.gr-table th { background: var(--gr-head); font-weight: 700; text-align: center; vertical-align: middle; }
.gr-table th.gr-sub { background: var(--gr-sub); }
.gr-table td.gr-oc { font-weight: 700; min-width: 140px; }
.gr-table td.gr-plain { min-width: 180px; }
.gr-table tr.gr-ohead td { background: var(--gr-row); font-weight: 700; }
.gr-table td.gr-empty { text-align: center; color: var(--ink-secondary); padding: 18px; }
.gr-cert { display: inline-block; white-space: nowrap; font-weight: 700; border-radius: 3px; padding: 1px 6px; }
.gr-cert.high { color: var(--gr-high); background: var(--gr-high-bg); }
.gr-cert.mod { color: var(--gr-mod); background: var(--gr-mod-bg); }
.gr-cert.low { color: var(--gr-low); background: var(--gr-low-bg); }
.gr-cert.vlow { color: var(--gr-vlow); background: var(--gr-vlow-bg); }
.gr-cert.none { color: var(--ink-secondary); font-weight: 400; }
.gr-sym { letter-spacing: 1px; }
.gr-imp { font-weight: 700; text-align: center; white-space: nowrap; }
.gr-imp.crit { color: var(--gr-crit); }
.gr-foot { font-size: 11.5px; color: var(--ink-body); margin-top: 6px; }
.gr-foot p { margin: 2px 0; }
.gr-legend, .gr-notes { margin-top: 6px; }
.gr-legend__h { font-weight: 700; color: var(--ink); margin-top: 6px; }
/* düzenleme kipi */
.cx-editing .gr-table td[contenteditable], .cx-editing .gr-title[contenteditable] { outline: 1px dashed var(--accent-300); outline-offset: -3px; cursor: text; }
.cx-editing .gr-table td[contenteditable]:focus, .cx-editing .gr-title[contenteditable]:focus { outline: 2px solid var(--accent-600); background: var(--accent-50); }
.gr-table td.ed, .gr-title.ed { box-shadow: inset 3px 0 0 var(--accent-500); }
.cx-tabs { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 3px; background: var(--layer-inset); margin-bottom: var(--space-3); }
.cx-tabs button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--ink-secondary); border-radius: var(--radius-pill); padding: 6px 14px; cursor: pointer; }
.cx-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

@media (max-width: 1100px) { .cx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cx-dom, .cx-etd { grid-template-columns: 1fr; } .cx-dom > span, .cx-etd > span { padding-top: 0; } }
@media (max-width: 600px) { .cx-grid { grid-template-columns: 1fr; } .cx-span2 { grid-column: auto; } }
.gr-prof td:nth-child(11) { min-width: 150px; } .gr-prof td:nth-child(7) { min-width: 130px; } .gr-prof td:nth-child(12) { min-width: 120px; }
