/* Kontext: the three levels, with what goes along on the right. Only what ws.css lacks. */
.kx-head { margin-bottom: 18px; }
.kx-health { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 18px; }
.kx-health .i { flex: none; }
.kx-map { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 26px; }
.kx-dg-wide { max-width: 860px; }
.kx-dg-narrow { display: none; max-width: 420px; }
.kx-mod { cursor: pointer; }
.dg text.mono.ontext { fill: var(--on-accent); }
.kx-skeleton { max-width: 640px; }

.kx-cols { align-items: start; }
.kx-main { min-width: 0; }
.kx-level { display: flex; flex-direction: column; gap: 20px; }
.kx-levelhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.kx-levelhead .meta { margin-top: 2px; }
.kx-version { flex: none; }
.kx-sp { flex: 1; min-width: 0; }
.kx-grow { flex: 1; min-width: 0; }

/* Ich */
.kx-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }
.kx-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kx-bereich { text-transform: none; letter-spacing: 0; font-size: 12px; padding: 4px 6px 4px 11px; white-space: normal; }
.kx-bereich button { display: inline-flex; border-radius: 50%; }
.kx-bereich button:hover { background: var(--surface-sunken); }
.kx-bereich .i { width: 13px; height: 13px; }
.kx-bereich-in { flex: 1 1 200px; width: auto; min-width: 160px; padding: 7px 14px; border-radius: var(--radius-pill); font-size: 13.5px; }
.kx-ueber { min-height: 110px; }
.kx-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.kx-saved { color: var(--ink-muted); }
.kx-erase { margin-left: auto; color: var(--ink-muted); font-weight: 500; }

/* Team */
.kx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kx-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 150px; }
.kx-pane.kx-wide { grid-column: 1 / -1; min-height: 0; }
.kx-pane.kx-small { min-height: 0; }
.kx-pane > .kx-panehead { margin-bottom: 0; }
.kx-pane > .tag { align-self: flex-start; }
.kx-panehead { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 30px; }
.kx-panehead .btn { flex: none; }
.kx-paneread { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.kx-empty { color: var(--ink-muted); }
.kx-more { color: var(--ink-muted); }
.kx-choiceval { font-weight: 700; font-size: 15px; }
.kx-edit .textarea { background: var(--surface-raised); }
.kx-edit .seg { align-self: flex-start; }

/* Text from the server: bullets as ticked rings, the deck's Ton pane. */
.kx-md { font-size: 14px; line-height: 1.5; }
.kx-md ul { list-style: none; padding-left: 0; margin: 0 0 .7em; }
.kx-md ul:last-child { margin-bottom: 0; }
.kx-md li { position: relative; padding-left: 24px; margin-bottom: .45em; }
.kx-md li::before {
  content: ""; position: absolute; left: 0; top: .22em; width: 15px; height: 15px; border: 1.5px solid var(--line); border-radius: 50%;
}
.kx-md li::after {
  content: ""; position: absolute; left: 5.5px; top: calc(.22em + 3.5px); width: 4px; height: 7px; border: solid var(--line); border-width: 0 1.5px 1.5px 0; transform: rotate(40deg);
}
.kx-md p:has(+ ul) { font-weight: 700; margin-bottom: .35em; }
/* A document's list and a template's fields are no ticks: a tick would approve what "Was wir nie tun" names. */
.kx-md.kx-plain li { padding-left: 14px; }
.kx-md.kx-plain li::before { left: 1px; top: .62em; width: 4px; height: 4px; border: 0; background: var(--line); }
.kx-md.kx-plain li::after { display: none; }

.kx-doc { padding: 12px 20px; }
.kx-doc summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; cursor: pointer; list-style: none; min-height: 28px; }
.kx-doc summary::-webkit-details-marker { display: none; }
.kx-doc .kx-chev { margin-left: auto; transition: transform var(--duration-quick); }
.kx-doc[open] .kx-chev { transform: rotate(180deg); }
.kx-doc[open] summary { margin-bottom: 10px; }
.kx-doc .md { overflow-wrap: anywhere; }
.kx-docsub { margin-bottom: 8px; }

/* Organisation */
.kx-rules { display: flex; flex-direction: column; gap: 12px; }
.kx-rule { align-items: flex-start; font-size: 14px; line-height: 1.4; }
.kx-rule .i { margin-top: 1px; }

/* What goes along */
.kx-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kx-sidehead { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; }
.kx-proberow { display: flex; align-items: center; gap: 12px; }
.kx-probe-btn { flex: none; }
.kx-preview { height: calc(100dvh - 430px); min-height: 280px; overflow-y: auto; padding: 0 16px 14px; }
.kx-preview .md { font-size: 12.5px; line-height: 1.5; }
.kx-preview .md h3 { font-size: 13px; margin-top: .9em; }
.kx-preview .md .open { font-size: 11px; }
.kx-preview .md code { font-size: 11.5px; }
.kx-psec + .kx-psec { margin-top: 14px; border-top: 1.5px solid var(--line); }
.kx-phead { position: sticky; top: 0; z-index: 1; padding: 10px 0 8px; background: var(--surface); }
.kx-pempty { margin-top: 14px; padding: 7px 12px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); font-size: 12.5px; }
.kx-pend { margin-top: 14px; padding-top: 10px; border-top: 1.5px solid var(--line-soft); }

/* Verlauf */
.kx-hist { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; }
.kx-histval { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 10.5em; overflow-y: auto; }
.kx-refused { color: var(--ink); font-weight: 600; }

/* Kontext-Probe */
.kx-probe { --kx-probe-pad: 24px; display: flex; flex-direction: column; gap: 12px; width: min(920px, calc(100vw - 32px)); padding: var(--kx-probe-pad); }
/* Its head stays, edge to edge: the way out, wherever the answers are scrolled. */
.kx-probe > .kx-panehead {
  position: sticky; top: calc(-1 * var(--kx-probe-pad)); z-index: 2; flex: none; margin: calc(-1 * var(--kx-probe-pad)) calc(-1 * var(--kx-probe-pad)) 0;
  padding: 14px var(--kx-probe-pad) 10px; border-bottom: 1.5px solid var(--line-soft); background: var(--surface-raised);
}
.kx-probe-q { min-height: 62px; }
.kx-switches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; }
.kx-switchrow { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; min-width: 0; }
.kx-probe-client { max-width: 320px; }
.kx-probe-client .select { background: var(--surface); }
.kx-always { display: flex; align-items: center; gap: 7px; }
.kx-probe-cost { flex: 1 1 260px; min-width: 0; }
.kx-runs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; scroll-margin-top: 62px; }
.kx-runs.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kx-run { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px; }
.kx-trace { display: flex; flex-wrap: wrap; gap: 5px; }
.kx-trace .tag { padding: 2px 7px; font-size: 10px; white-space: normal; }
.kx-answer { font-size: 14.5px; }

@media (min-width: 1280px) {
  .kx-map { flex-direction: row; align-items: center; gap: 28px; }
  .kx-dg-wide { flex: 1 1 0; min-width: 0; }
  .kx-seg { flex: none; }
}
@media (max-width: 1080px) {
  .kx-side { position: static; }
  .kx-preview { height: 340px; }
}
@media (max-width: 820px) {
  .kx-map { margin-bottom: 24px; }
  .kx-erase { margin-left: 0; }
  .kx-dg-wide { display: none; }
  .kx-dg-narrow { display: block; }
}
@media (max-width: 640px) {
  .kx-seg { align-self: stretch; }
  .kx-seg button { flex: 1; padding-left: 8px; padding-right: 8px; }
  .kx-grid { grid-template-columns: minmax(0, 1fr); }
  .kx-pane { min-height: 0; }
  .kx-switches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kx-runs.two { grid-template-columns: minmax(0, 1fr); }
  .kx-probe { --kx-probe-pad: 18px; }
}
.kx-diff { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; overflow-wrap: anywhere; }
.kx-diff .add { color: var(--ink); }
.kx-diff .del { text-decoration: line-through; }
.kx-full summary { cursor: pointer; }
.kx-newer-text { white-space: pre-wrap; max-height: 12em; overflow-y: auto; }
