/* Kesit Moment–Eğrilik Analizi — arayüz stilleri (tümü .kme kapsamında) */
.kme {
  --kme-ink: #18212b;
  --kme-ink-2: #3a4653;
  --kme-muted: #6b7480;
  --kme-paper: #f7f6f2;
  --kme-card: #ffffff;
  --kme-line: #e2dfd8;
  --kme-line-2: #cfcbc2;
  --kme-accent: #c2410c;
  --kme-accent-ink: #ffffff;
  --kme-steel: #1d5c87;
  --kme-ok: #2f7d4f;
  --kme-warn: #a16207;
  --kme-warn-bg: #fdf6e3;
  --kme-err: #b42318;
  --kme-radius: 10px;
  --kme-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --kme-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  font-family: var(--kme-sans);
  font-size: 15px;
  line-height: 1.45;
  color: var(--kme-ink);
  background: var(--kme-paper);
  border: 1px solid var(--kme-line);
  border-radius: 14px;
  padding: 22px;
  margin: 1.5em 0;
  max-width: 1280px;
  -webkit-font-smoothing: antialiased;
}
.kme *, .kme *::before, .kme *::after { box-sizing: border-box; }
.kme h2, .kme h3, .kme h4, .kme p { margin: 0; padding: 0; font-family: inherit; color: inherit; letter-spacing: normal; text-transform: none; }
.kme button, .kme input, .kme select { font-family: inherit; font-size: 14px; }

/* Header */
.kme-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--kme-line); margin-bottom: 18px; }
.kme-title { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.kme-sub { color: var(--kme-muted); font-size: 13.5px; margin-top: 4px; }
.kme-lang { display: inline-flex; gap: 6px; flex: none; }
.kme-lang button { display: inline-flex; align-items: center; justify-content: center; border: 2px solid transparent; background: transparent; padding: 2px; border-radius: 6px; cursor: pointer; line-height: 0; opacity: .45; filter: grayscale(.5); transition: opacity .15s, filter .15s, border-color .15s; }
.kme-lang button svg { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.kme-lang button:hover { opacity: .85; filter: none; }
.kme-lang button[aria-pressed="true"] { opacity: 1; filter: none; border-color: var(--kme-ink); }

/* Grid */
.kme-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .kme-grid { grid-template-columns: 1fr; } }

/* Form */
.kme-form { display: flex; flex-direction: column; gap: 12px; }
.kme-seg { display: grid; grid-template-columns: 1fr 1fr; background: #ece9e2; border-radius: 9px; padding: 3px; gap: 3px; }
.kme-seg button { border: 0; background: transparent; padding: 8px 6px; border-radius: 7px; cursor: pointer; font-weight: 600; color: var(--kme-ink-2); display: flex; align-items: center; justify-content: center; gap: 7px; line-height: 1.1; }
.kme-seg button svg { flex: none; }
.kme-seg button[aria-pressed="true"] { background: var(--kme-card); color: var(--kme-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kme-fs { background: var(--kme-card); border: 1px solid var(--kme-line); border-radius: var(--kme-radius); padding: 12px 14px 14px; margin: 0; min-width: 0; }
.kme-fs > legend, .kme-fs-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kme-muted); padding: 0; margin: 0 0 10px; float: left; width: 100%; }
.kme-fs > legend ~ * { clear: both; }
.kme-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.kme-row.kme-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kme-row + .kme-row { margin-top: 10px; }
.kme-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kme-f > span { font-size: 12.5px; color: var(--kme-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kme-f > span i { font-style: normal; color: var(--kme-muted); }
.kme-in { position: relative; display: flex; align-items: stretch; }
.kme input[type="number"], .kme input[type="text"], .kme select {
  width: 100%; min-width: 0; height: 36px; margin: 0; padding: 0 9px; border: 1px solid var(--kme-line-2); border-radius: 7px; background: #fff; color: var(--kme-ink); box-shadow: none; line-height: normal;
  font-variant-numeric: tabular-nums;
}
.kme input[type="number"] { padding-right: 38px; font-family: var(--kme-mono); font-size: 13.5px; -moz-appearance: textfield; }
.kme input[type="number"]::-webkit-outer-spin-button, .kme input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kme-u { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--kme-muted); pointer-events: none; }
.kme input:focus, .kme select:focus { outline: 2px solid color-mix(in srgb, var(--kme-accent) 35%, transparent); outline-offset: 0; border-color: var(--kme-accent); }
.kme input.kme-bad { border-color: var(--kme-err); background: #fff6f5; }
.kme-hint { font-size: 12px; color: var(--kme-muted); margin-top: 8px; }
.kme-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kme-btn { appearance: none; border: 1px solid var(--kme-line-2); background: var(--kme-card); color: var(--kme-ink); border-radius: 8px; padding: 0 14px; height: 40px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; line-height: 1; }
.kme-btn:hover { border-color: var(--kme-ink-2); }
.kme-btn-p { background: var(--kme-accent); border-color: var(--kme-accent); color: var(--kme-accent-ink); flex: 1; }
.kme-btn-p:hover { filter: brightness(.94); border-color: var(--kme-accent); }
.kme-btn[disabled] { opacity: .55; cursor: progress; }
.kme-btn svg { flex: none; }

/* Output */
.kme-out { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kme-card { background: var(--kme-card); border: 1px solid var(--kme-line); border-radius: var(--kme-radius); padding: 16px; min-width: 0; }
.kme-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.kme-card-h h3 { font-size: 15px; font-weight: 700; }
.kme-card-h small { color: var(--kme-muted); font-size: 12.5px; }
.kme-prev { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 640px) { .kme-prev { grid-template-columns: 1fr; } }
.kme-svgbox { width: 100%; aspect-ratio: 1 / 1; max-height: 360px; display: flex; align-items: center; justify-content: center; }
.kme-svgbox svg { width: 100%; height: 100%; display: block; }
.kme-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kme-fact { border: 1px solid var(--kme-line); border-radius: 8px; padding: 8px 10px; }
.kme-fact b { display: block; font-family: var(--kme-mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kme-fact span { font-size: 11.5px; color: var(--kme-muted); }

.kme-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kme-kpi { background: var(--kme-card); border: 1px solid var(--kme-line); border-radius: var(--kme-radius); padding: 12px 14px; border-top: 3px solid var(--kme-ink); }
.kme-kpi:first-child { border-top-color: var(--kme-accent); }
.kme-kpi span { display: block; font-size: 12px; color: var(--kme-muted); }
.kme-kpi b { display: block; font-family: var(--kme-mono); font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kme-kpi em { font-style: normal; font-size: 12px; color: var(--kme-muted); font-family: var(--kme-sans); margin-left: 3px; letter-spacing: 0; }

.kme-tabs { display: inline-flex; gap: 2px; background: #ece9e2; border-radius: 8px; padding: 3px; }
.kme-tabs button { border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--kme-ink-2); line-height: 1.1; }
.kme-tabs button[aria-selected="true"] { background: #fff; color: var(--kme-ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kme-chart { position: relative; width: 100%; height: 400px; }
@media (max-width: 640px) { .kme-chart { height: 300px; } }
.kme-chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kme-tip { position: absolute; pointer-events: none; background: var(--kme-ink); color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 6px; font-family: var(--kme-mono); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s; z-index: 2; }
.kme-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--kme-ink-2); }
.kme-legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid currentColor; vertical-align: middle; margin-right: 6px; }
.kme-legend i.d { border-top-style: dashed; }
.kme-legend i.p { width: 9px; height: 9px; border: 0; border-radius: 50%; background: currentColor; }

.kme-strain { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.kme-strain .kme-svgbox { aspect-ratio: 16 / 8; max-height: 300px; }
.kme-slider { display: flex; align-items: center; gap: 12px; }
.kme-slider input[type="range"] { flex: 1; accent-color: var(--kme-accent); margin: 0; }
.kme-slider output { font-family: var(--kme-mono); font-size: 12.5px; color: var(--kme-ink-2); min-width: 9ch; text-align: right; }

.kme-tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
.kme table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0; border: 0; }
.kme th, .kme td { padding: 7px 9px; border: 0; border-bottom: 1px solid var(--kme-line); text-align: right; white-space: nowrap; background: transparent; }
.kme th { font-size: 11.5px; font-weight: 700; color: var(--kme-muted); text-transform: none; letter-spacing: .01em; background: #faf9f6; }
.kme th:first-child, .kme td:first-child { text-align: left; }
.kme td { font-family: var(--kme-mono); font-variant-numeric: tabular-nums; }
.kme td:first-child { font-family: var(--kme-sans); font-weight: 600; }
.kme td .kme-tag { font-family: var(--kme-sans); font-size: 11px; padding: 2px 7px; border-radius: 99px; background: #eef2f6; color: var(--kme-steel); font-weight: 600; }
.kme td .kme-tag.c { background: #fdeee6; color: var(--kme-accent); }
.kme tr:last-child td { border-bottom: 0; }
.kme-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.kme-mat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
.kme-mat table td:first-child { font-weight: 500; }

.kme-msgs { display: flex; flex-direction: column; gap: 6px; }
.kme-msg { border-radius: 8px; padding: 9px 12px; font-size: 13px; background: var(--kme-warn-bg); color: #6b4a07; border: 1px solid #f1e2b8; }
.kme-msg.e { background: #fff1f0; color: var(--kme-err); border-color: #f7cfcb; }
.kme-details summary { cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kme-details summary::-webkit-details-marker { display: none; }
.kme-details summary::after { content: "+"; font-family: var(--kme-mono); color: var(--kme-muted); font-size: 18px; }
.kme-details[open] summary::after { content: "–"; }
.kme-details .kme-tw { max-height: 420px; overflow: auto; margin-top: 12px; }
.kme-details thead th { position: sticky; top: 0; }

.kme-empty { text-align: center; color: var(--kme-muted); padding: 34px 16px; border: 1.5px dashed var(--kme-line-2); border-radius: var(--kme-radius); font-size: 14px; }
.kme-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--kme-line); font-size: 12px; color: var(--kme-muted); display: flex; flex-direction: column; gap: 4px; }
.kme-hide { display: none !important; }
.kme-spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kme-rot .7s linear infinite; }
@keyframes kme-rot { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .kme { padding: 14px; border-radius: 10px; }
  .kme-row.kme-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kme-title { font-size: 19px; }
}
.kme-mat td:first-child { white-space: normal; }
.kme-mat td:last-child { padding-left: 4px; }

.kme td .kme-tag.ok { background: #e8f3ec; color: var(--kme-ok); }
.kme-ol { margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--kme-ink-2); display: flex; flex-direction: column; gap: 6px; }
.kme-ol li { margin: 0; padding: 0; line-height: 1.5; }
.kme-brand a { color: var(--kme-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--kme-line-2); }
.kme-brand a:hover { color: var(--kme-accent); border-color: var(--kme-accent); }
/* tema animasyon betiklerine karşı koruma */
.kme .kme-row, .kme .kme-f, .kme .kme-fs, .kme .kme-card { visibility: visible !important; opacity: 1 !important; }

/* v1.2 — yön seçimi, ilerleme, özet */
.kme-seg-s { margin-bottom: 10px; }
.kme-seg-s button { padding: 6px; font-size: 13px; }
.kme-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.kme-chip { appearance: none; border: 1px solid var(--kme-line-2); background: #fff; color: var(--kme-ink-2); border-radius: 7px; height: 32px; padding: 0; font-family: var(--kme-mono); font-size: 12.5px; cursor: pointer; line-height: 1; }
.kme-chip:hover { border-color: var(--kme-ink-2); }
.kme-chip[aria-pressed="true"] { background: var(--kme-ink); border-color: var(--kme-ink); color: #fff; }
.kme-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kme-quick button { appearance: none; border: 0; background: #ece9e2; color: var(--kme-ink); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; line-height: 1.2; }
.kme-quick button:hover { background: #e0dcd2; }
.kme-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; cursor: pointer; line-height: 1.35; }
.kme-check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--kme-accent); flex: none; }
.kme-prog { display: flex; flex-direction: column; gap: 5px; }
.kme-prog > div { height: 6px; background: #ece9e2; border-radius: 99px; overflow: hidden; }
.kme-prog i { display: block; height: 100%; width: 0; background: var(--kme-accent); transition: width .2s; }
.kme-prog span { font-size: 12.5px; color: var(--kme-muted); }
.kme-dirbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kme-sum tbody tr { cursor: pointer; }
.kme-sum tbody tr:hover td { background: #faf9f6; }
.kme-sum tbody tr.sel td { background: #fdf3ec; }
.kme-msg.i { background: #f3f6f9; border-color: #dde5ec; color: #33475b; }
