.nevv-sdp-manual-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: var(--nevv-sdp-button-height, 42px);
  padding: 0 .75rem;
  border-radius: var(--nevv-sdp-radius-global, 12px);
  border: 1px solid var(--nevv-sdp-btn-other-border, #334155);
  background: var(--nevv-sdp-btn-other-bg, #334155);
  color: var(--nevv-sdp-btn-other-color, #fff);
  text-decoration: none;
  font-family: var(--nevv-sdp-font-family, system-ui, sans-serif);
  font-size: var(--nevv-sdp-btn-other-font-size, 15px);
  font-weight: 700;
}
.nevv-sdp-manual-trigger:hover,
.nevv-sdp-manual-trigger:focus-visible {
  background: var(--nevv-sdp-btn-other-hover-bg, #1e293b);
  color: var(--nevv-sdp-btn-other-hover-color, #fff);
  border-color: var(--nevv-sdp-btn-other-hover-border, #1e293b);
  outline: none;
}
.nevv-sdp-manual-trigger__icon {
  width: 1.4em;
  height: 1.4em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nevv-sdp-btn-other-color, #fff) 18%, transparent);
  line-height: 1;
}
.nevv-sdp-manual-panel {
  position: fixed;
  z-index: 9988;
  top: calc(var(--nevv-sdp-topbar-min-height, 64px) + 24px);
  bottom: calc(var(--nevv-sdp-bottombar-min-height, 64px) + 24px);
  left: 42px;
  width: min(420px, calc(100vw - 72px));
  color: var(--nevv-sdp-text-normal-color, #1f2933);
  font-family: var(--nevv-sdp-font-family, system-ui, sans-serif);
}
.nevv-sdp-manual-panel__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  border-radius: var(--nevv-sdp-radius-global, 12px);
  background: var(--nevv-sdp-bg-card, #fff);
  box-shadow: var(--nevv-sdp-topbar-shadow, 0 2px 12px rgba(0,0,0,.18));
}
.nevv-sdp-manual-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  background: var(--nevv-sdp-bg-card, #fff);
}
.nevv-sdp-manual-panel__header strong { display: block; font-size: 1.05rem; }
.nevv-sdp-manual-panel__header span { display: block; margin-top: .15rem; color: var(--nevv-sdp-text-description-color, #475569); font-size: .9rem; }
.nevv-sdp-manual-panel__actions { display: inline-flex; gap: .35rem; flex: 0 0 auto; }
.nevv-sdp-manual-panel__close,
.nevv-sdp-manual-panel__edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  background: var(--nevv-sdp-bg-card, #fff);
  color: var(--nevv-sdp-text-normal-color, #1f2933);
  text-decoration: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.nevv-sdp-manual-panel__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
  line-height: 1.5;
}
.nevv-sdp-manual-panel__body h1,
.nevv-sdp-manual-panel__body h2,
.nevv-sdp-manual-panel__body h3 { margin-top: 0; }
.nevv-sdp-manual-panel__body ul,
.nevv-sdp-manual-panel__body ol { padding-left: 1.2rem; }
.nevv-sdp-manual-panel__body code {
  padding: .1rem .25rem;
  border-radius: .35rem;
  background: color-mix(in srgb, var(--nevv-sdp-bg-card, #fff) 70%, var(--nevv-sdp-btn-other-bg, #334155));
}
.nevv-sdp-manual-editor {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10120;
  color: var(--nevv-sdp-text-normal-color, #1f2933);
  font-family: var(--nevv-sdp-font-family, system-ui, sans-serif);
}
.nevv-sdp-manual-editor.is-open { display: block; }
.nevv-sdp-manual-editor__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
}
.nevv-sdp-manual-editor__box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  border-radius: var(--nevv-sdp-radius-global, 12px);
  background: var(--nevv-sdp-bg-card, #fff);
  box-shadow: var(--nevv-sdp-topbar-shadow, 0 2px 18px rgba(0,0,0,.22));
}
.nevv-sdp-manual-editor__header,
.nevv-sdp-manual-editor__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
}
.nevv-sdp-manual-editor__footer { border-top: 1px solid var(--nevv-sdp-border-card, #d8dbe2); border-bottom: 0; justify-content: flex-end; }
.nevv-sdp-manual-editor__header h3 { margin: 0; }
.nevv-sdp-manual-editor__header button {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  background: var(--nevv-sdp-bg-card, #fff);
  color: var(--nevv-sdp-text-normal-color, #1f2933);
  font-size: 1.35rem;
  cursor: pointer;
}
.nevv-sdp-manual-editor__field {
  display: block;
  padding: 1rem;
  overflow: auto;
}
.nevv-sdp-manual-editor__field span { display: block; font-weight: 700; margin-bottom: .4rem; }
.nevv-sdp-manual-editor__field textarea {
  width: 100%;
  min-height: 420px;
  box-sizing: border-box;
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  border-radius: var(--nevv-sdp-radius-global, 12px);
  background: var(--nevv-sdp-bg-card, #fff);
  color: var(--nevv-sdp-text-normal-color, #1f2933);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  padding: .75rem;
}
@media (max-width: 900px) {
  .nevv-sdp-manual-panel {
    inset: 0;
    width: auto;
    z-index: 10040;
    background: var(--nevv-sdp-bg-page, #f4f5f7);
    padding: .75rem;
  }
  .nevv-sdp-manual-panel__inner { height: 100%; }
  .nevv-sdp-manual-trigger__label { display: none; }
  .nevv-sdp-manual-editor__field textarea { min-height: 55vh; }
}

/* v0.1.1: manual panel follows measured bars and is full-screen on mobile. */
.nevv-sdp-manual-panel {
  top: calc(var(--nevv-sdp-topbar-actual-height, var(--nevv-sdp-topbar-min-height, 64px)) + 16px);
  bottom: calc(var(--nevv-sdp-bottombar-actual-height, var(--nevv-sdp-bottombar-min-height, 64px)) + 16px);
}

@media (max-width: 900px) {
  .nevv-sdp-manual-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .nevv-sdp-manual-panel__inner {
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    box-sizing: border-box;
  }
}

/* v0.1.3: opening/closing manual does not reload the page. */
.nevv-sdp-manual-trigger {
  appearance: none;
  cursor: pointer;
}
.nevv-sdp-manual-panel:not(.is-open) {
  display: none;
}
.nevv-sdp-manual-panel__close-fallback {
  display: none !important;
}
.nevv-sdp-manual-panel__close {
  cursor: pointer;
}

/* v0.1.4: na mobile przycisk instrukcji nie moze zostawac pusty. */
@media (max-width: 900px) {
  .nevv-sdp-manual-trigger__label {
    display: inline !important;
  }
}

/* v0.1.5: edytor instrukcji ma tryb wizualny/kod i wstawianie zalacznikow. */
.nevv-sdp-manual-editor__box {
  width: min(1120px, calc(100vw - 2rem));
}
.nevv-sdp-manual-editor__content {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1rem;
}
.nevv-sdp-manual-editor__field {
  padding: 0;
  overflow: visible;
}
.nevv-sdp-manual-editor__field > span {
  display: block;
  font-weight: 700;
  margin-bottom: .5rem;
}
.nevv-sdp-manual-editor__field .wp-editor-wrap {
  border: 1px solid var(--nevv-sdp-border-card, #d8dbe2);
  border-radius: var(--nevv-sdp-radius-global, 12px);
  overflow: hidden;
  background: var(--nevv-sdp-bg-card, #fff);
}
.nevv-sdp-manual-editor__field .wp-editor-container {
  border: 0;
}
.nevv-sdp-manual-editor__field textarea.wp-editor-area,
.nevv-sdp-manual-editor__field textarea {
  width: 100%;
  min-height: 430px;
  box-sizing: border-box;
}
.nevv-sdp-manual-editor__help {
  margin: .7rem 0 0;
  color: var(--nevv-sdp-text-description-color, #475569);
  font-size: .95rem;
}
.nevv-sdp-manual-editor__attachments {
  margin-top: .9rem;
}
.nevv-sdp-manual-editor__attachments .nevv-sdp-attachment-insert-field {
  margin: 0;
}
.nevv-sdp-manual-panel__body .nevv-sdp-attachment-link {
  font-weight: 700;
}
@media (max-width: 900px) {
  .nevv-sdp-manual-editor__box {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .nevv-sdp-manual-editor__field textarea.wp-editor-area,
  .nevv-sdp-manual-editor__field textarea {
    min-height: 52dvh;
  }
}

/* v0.1.6: mniej opisow w edytorze, wiecej miejsca na tresc; zalaczniki w stopce. */
.nevv-sdp-manual-editor__field > span,
.nevv-sdp-manual-editor__help {
  display: none !important;
}
.nevv-sdp-manual-editor__content {
  padding: 1rem 1rem .5rem;
}
.nevv-sdp-manual-editor__field textarea.wp-editor-area,
.nevv-sdp-manual-editor__field textarea {
  min-height: 560px;
}
.nevv-sdp-manual-editor__footer {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.nevv-sdp-manual-editor__footer-left,
.nevv-sdp-manual-editor__footer-right {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.nevv-sdp-manual-editor__attachments {
  margin: 0;
}
.nevv-sdp-manual-editor__attachments .nevv-sdp-attachment-editor-actions {
  display: flex;
  gap: .6rem;
  align-items: center;
  margin: 0;
}
.nevv-sdp-manual-editor__attachments small {
  display: none !important;
}
@media (max-width: 900px) {
  .nevv-sdp-manual-editor__box {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .nevv-sdp-manual-editor__field textarea.wp-editor-area,
  .nevv-sdp-manual-editor__field textarea {
    min-height: 55dvh;
  }
  .nevv-sdp-manual-editor__footer-left,
  .nevv-sdp-manual-editor__footer-right {
    width: 100%;
    justify-content: flex-end;
  }
  .nevv-sdp-manual-editor__footer-left {
    justify-content: flex-start;
  }
}
