@charset "UTF-8";
.ml {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--paper);
  color: var(--ink);
}

.ml * {
  box-sizing: border-box;
}

.ml button {
  font-family: inherit;
}

.ml-faint {
  color: var(--ink-faint);
}

/* ── menu kontekstowe (port .fl-menu z makiety) ───────────── */
.ml-mwrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ml-mbd {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: default;
}

.ml-menu {
  position: absolute;
  top: 30px;
  right: 0;
  min-width: 218px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  padding: 5px;
  z-index: 9;
}

.ml-menu.up {
  top: auto;
  bottom: 30px;
}

.ml-mitem {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.ml-mitem svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ml-mitem:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.ml-mitem.dgr {
  color: var(--danger-ink);
}

.ml-mitem.dgr:hover {
  background: var(--danger-soft);
}

.ml-msep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

/* ── chip filtra (port .f-fchip z makiety) ────────────────── */
.ml-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--paper);
  color: var(--ink-mute);
  font-family: inherit;
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.ml-chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.ml-chip.on {
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 32%, transparent);
  color: var(--accent-ink);
  font-weight: 600;
}

.ml-chip i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: oklch(58% 0.13 var(--rh, 255));
  flex-shrink: 0;
}

.ml-chip__t {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── znaczniki (odbiorca, zdarzenie, zmienna) ─────────────── */
.ml-to {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  background: oklch(96.5% 0.022 var(--rh, 255));
  color: oklch(44% 0.11 var(--rh, 255));
  border: 1px solid oklch(90% 0.045 var(--rh, 255));
}

.ml-to i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.75;
  flex-shrink: 0;
}

.ml-to em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.82;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme=dark] .ml-to {
  background: oklch(29% 0.05 var(--rh, 255));
  color: oklch(83% 0.09 var(--rh, 255));
  border-color: oklch(38% 0.06 var(--rh, 255));
}

.ml-ev {
  font: 500 11px/1 var(--font-mono);
  color: var(--ink-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-vr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 3px;
}

.ml-mi {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: oklch(50% 0.11 var(--rh, 255));
  background: oklch(96.5% 0.022 var(--rh, 255));
  border: 1px solid oklch(90% 0.045 var(--rh, 255));
}

.ml-mi svg {
  width: 14px;
  height: 14px;
}

html[data-theme=dark] .ml-mi {
  color: oklch(80% 0.1 var(--rh, 255));
  background: oklch(29% 0.05 var(--rh, 255));
  border-color: oklch(38% 0.065 var(--rh, 255));
}

/* ── stopka / notka ──────────────────────────────────────── */
.ml-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  flex-shrink: 0;
  font: 500 10.5px/1 var(--font-mono);
  color: var(--ink-faint);
}

.ml-foot svg {
  width: 12px;
  height: 12px;
}

.ml-foot__sp {
  margin-left: auto;
}

.ml-note {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  font: 500 10.5px/1.4 var(--font-mono);
  color: var(--ink-faint);
}

.ml-note svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.ml-note__sp {
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── lista + podgląd (wariant B) ──────────────────────────── */
.ml-split {
  flex: 1;
  min-height: 0;
  display: flex;
}

.ml-lst {
  width: 396px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
}

.ml-lsth {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.ml-lchips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.ml-lsts {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.ml-li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 2px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.ml-li:hover {
  background: var(--paper-2);
}

.ml-li.on {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.ml-li__b {
  min-width: 0;
}

.ml-li .n {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-li .s {
  display: block;
  font-size: 11.5px;
  color: var(--ink-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.ml-li.on .s {
  color: var(--ink-soft);
}

.ml-li mark,
.ml-hl {
  background: color-mix(in oklab, var(--accent) 24%, transparent);
  color: inherit;
  border-radius: 2px;
}

.ml-pv {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper-2);
}

.ml-pvh {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  position: relative;
}

.ml-pvh .t {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-pvh__sp {
  flex: 1;
}

.ml-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 16px;
  margin: 0;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}

.ml-meta dt {
  font: 600 9.5px/1.5 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.ml-meta dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ml-meta dd.ml-ev {
  font-size: 11.5px;
  color: var(--ink-mute);
}

.ml-meta dd.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ml-pvb {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: var(--bg);
}

/* ── edytor: pasek akcji ─────────────────────────────────── */
.ml-ebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  position: relative;
  flex-wrap: wrap;
}

.ml-ebar .t {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.ml-ebar__sep {
  width: 1px;
  height: 18px;
  background: var(--line-2);
  flex-shrink: 0;
}

.ml-ebar__sp {
  flex: 1;
}

.ml-dirty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 10.5px/1 var(--font-mono);
  color: var(--warn-ink);
  white-space: nowrap;
}

.ml-dirty i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--warn);
}

.ml-dirty svg {
  width: 12px;
  height: 12px;
}

.ml-dirty.ok {
  color: var(--ok-ink);
}

/* ── edytor: dane podstawowe ─────────────────────────────── */
.ml-data {
  display: grid;
  grid-template-columns: 1.05fr 1.5fr minmax(200px, 240px) minmax(220px, 265px);
  gap: 12px 14px;
  padding: 11px 14px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  flex-shrink: 0;
}

.ml-f {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.ml-f.wide {
  grid-column: 1/-1;
}

.ml-f label {
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}

.ml-in {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1;
  outline: none;
}

.ml-in:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
}

.ml-in.mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

select.ml-in {
  appearance: none;
  cursor: pointer;
  padding-right: 26px;
}

select.ml-in option {
  background: var(--paper);
  color: var(--ink);
}

.ml-selw {
  position: relative;
  display: flex;
}

.ml-selw .cv {
  position: absolute;
  right: 8px;
  top: 8px;
  color: var(--ink-faint);
  pointer-events: none;
}

.ml-selw .cv svg {
  width: 13px;
  height: 13px;
}

/* ── edytor: obszar roboczy ──────────────────────────────── */
.ml-work {
  flex: 1;
  min-height: 0;
  display: flex;
}

.ml-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex-basis: 0;
  flex-shrink: 1;
}

.ml-pane--code {
  flex-grow: var(--ml-ratio, 0.5);
}

.ml-pane--pv {
  flex-grow: calc(1 - var(--ml-ratio, 0.5));
}

.ml-paneh {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  flex-shrink: 0;
}

.ml-paneh .ttl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
}

.ml-paneh .ttl svg {
  width: 14px;
  height: 14px;
  color: var(--ink-mute);
}

.ml-paneh .sp {
  flex: 1;
}

.ml-paneh .cnt {
  font: 500 10.5px/1 var(--font-mono);
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ml-drag {
  width: 5px;
  flex-shrink: 0;
  background: var(--line);
  cursor: col-resize;
  border: 0;
  padding: 0;
}

.ml-drag:hover,
.ml-drag.on {
  background: var(--accent);
}

.ml-seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--paper-3);
  flex-shrink: 0;
}

.ml-seg.off {
  opacity: 0.4;
  pointer-events: none;
}

.ml-seg button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-mute);
  font-family: inherit;
  font-weight: 500;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.ml-seg button svg {
  width: 12px;
  height: 12px;
}

.ml-seg button:hover {
  color: var(--ink);
}

.ml-seg button.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* ── edytor kodu (warstwa podświetlenia + przezroczysta textarea) ── */
.ml-edit {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--paper);
  --gut: 46px;
}

.ml-inner {
  position: relative;
  min-height: 100%;
  padding: 8px 0;
}

.ml-edit.nowrap .ml-inner {
  width: max-content;
  min-width: 100%;
}

.ml-lines {
  display: grid;
  grid-template-columns: var(--gut) minmax(0, 1fr);
  font: 500 12.5px/20px var(--font-mono);
}

.ml-edit.nowrap .ml-lines {
  grid-template-columns: var(--gut) max-content;
}

.ml-lines .g {
  text-align: right;
  padding-right: 12px;
  color: var(--ink-faint);
  opacity: 0.55;
  user-select: none;
  font-size: 11px;
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
}

.ml-lines .c {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  padding-right: 16px;
  color: var(--ink-soft);
  min-height: 20px;
}

.ml-edit.nowrap .ml-lines .c {
  white-space: pre;
}

.ml-lines i {
  font-style: normal;
}

.ml-lines .t {
  color: var(--accent-ink);
}

.ml-lines .a {
  color: oklch(52% 0.1 300deg);
}

.ml-lines .s {
  color: var(--ok-ink);
}

.ml-lines .p {
  color: var(--ink-faint);
}

.ml-lines .cm {
  color: var(--ink-faint);
  opacity: 0.8;
}

.ml-lines .v {
  color: var(--accent-ink);
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: 3px;
}

.ml-lines .v.bad {
  color: var(--warn-ink);
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--warn) 45%, transparent);
  text-decoration: underline wavy;
}

html[data-theme=dark] .ml-lines .a {
  color: oklch(78% 0.09 300deg);
}

.ml-ta {
  position: absolute;
  top: 8px;
  left: var(--gut);
  right: 0;
  bottom: 8px;
  margin: 0;
  padding: 0 16px 0 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--accent);
  font: 500 12.5px/20px var(--font-mono);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow: hidden;
  -webkit-text-fill-color: transparent;
}

.ml-edit.nowrap .ml-ta {
  white-space: pre;
}

.ml-ta::selection {
  background: color-mix(in oklab, var(--accent) 32%, transparent);
}

/* ── paleta zmiennych ────────────────────────────────────── */
.ml-vars {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  flex-shrink: 0;
  max-height: 158px;
  overflow: auto;
  padding: 6px 12px 10px;
}

.ml-vg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}

.ml-vg .lb {
  width: 82px;
  flex-shrink: 0;
  padding-top: 5px;
  font: 600 9.5px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.ml-vg .ch {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.ml-vg .ch.hint {
  font: 500 10px/1.5 var(--font-mono);
  color: var(--ink-faint);
  padding-top: 3px;
}

.ml-vch {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font: 500 11px/1 var(--font-mono);
  cursor: pointer;
}

.ml-vch:hover {
  border-color: color-mix(in oklab, var(--accent) 50%, transparent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.ml-vch.used {
  border-style: dashed;
  color: var(--ink-faint);
}

.ml-val {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  font: 500 11px/1.4 var(--font-mono);
  color: var(--ink-faint);
}

.ml-val svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.ml-val.warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.ml-val b {
  font-weight: 600;
  color: inherit;
}

/* ── podgląd wiadomości ─────────────────────────────────── */
.ml-pw {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.ml-dev {
  width: 920px;
  max-width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-2);
  transition: width 0.16s ease;
  flex-shrink: 0;
}

.ml-dev.mob {
  width: 392px;
  border-radius: 18px;
}

.ml-dev.dk {
  background: #14172A;
}

.ml-dev iframe {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
}

.ml-txt {
  width: 640px;
  max-width: 100%;
  white-space: pre-wrap;
  font: 500 11.5px/1.75 var(--font-mono);
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 0;
}

/* ── popover wysyłki testowej ───────────────────────────── */
.ml-pop {
  position: absolute;
  top: 42px;
  right: 14px;
  z-index: 9;
  width: 300px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  text-align: left;
}

.ml-pop .h {
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  margin-bottom: 9px;
}

.ml-pop .r {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.ml-pop .hint {
  font: 500 10.5px/1.45 var(--font-mono);
  color: var(--ink-faint);
  margin-top: 7px;
}

.ml-pop .sent {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ok-ink);
}

.ml-pop .sent svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── węższy content: lista schodzi z 396px, dane edytora na 2 kolumny ── */
@media (max-width: 1500px) {
  .ml-lst {
    width: 330px;
  }
  .ml-data {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 1100px) {
  .ml-lst {
    width: 288px;
  }
  .ml-data {
    grid-template-columns: 1fr;
  }
}
