.oden-edit-btn {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9999;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: 500 0.78rem/1 'IBM Plex Sans', system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.oden-edit-btn:hover {
  background: #333;
}

:root {
  --oden-edit-width: min(640px, 100vw);
}

html.oden-edit-open body {
  padding-right: var(--oden-edit-width);
}

html.oden-edit-open .header {
  right: var(--oden-edit-width);
  width: auto;
}

html.oden-edit-open .navbar {
  right: var(--oden-edit-width);
}

body,
.header,
.navbar {
  transition: padding-right 200ms ease, right 200ms ease, width 200ms ease;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .header,
  .navbar,
  .oden-edit-panel {
    transition: none;
  }
}

html.oden-edit-open .body {
  display: block;
  padding-left: 1rem;
  padding-right: 1rem;
}

html.oden-edit-open .nav-container {
  position: fixed;
  top: 3.5rem;
  left: 0;
  width: 15rem;
  max-width: none;
  height: auto;
  flex: none;
  visibility: hidden;
}

html.oden-edit-open body.nav-open .nav-container,
html.oden-edit-open .nav-container.is-active {
  visibility: visible;
}

html.oden-edit-open .nav-toggle {
  display: inline-block;
}

html.oden-edit-open aside.toc.sidebar {
  display: none;
}

.oden-edit-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: var(--oden-edit-width);
  background: #1e1e1e;
  color: #e6e6e6;
  display: flex;
  flex-direction: column;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 200ms ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.35);
}

.oden-edit-panel.is-open {
  transform: translateX(0);
}

.oden-edit-panel header,
.oden-edit-panel footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  background: #2a2a2a;
}

.oden-edit-panel header {
  border-bottom: 1px solid #333;
}

.oden-edit-panel footer {
  border-top: 1px solid #333;
}

.oden-edit-path {
  flex: 1;
  font: 0.75rem/1.3 'JetBrains Mono', ui-monospace, monospace;
  color: #9cdcfe;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oden-edit-status {
  flex: 1;
  font-size: 0.74rem;
  color: #aaa;
}

.oden-edit-close,
.oden-edit-save {
  background: transparent;
  color: #e6e6e6;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  font: 0.78rem 'IBM Plex Sans', system-ui, sans-serif;
}

.oden-edit-save {
  background: #0e639c;
  border-color: #0e639c;
}

.oden-edit-save:hover {
  background: #1177bb;
}

.oden-edit-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.oden-edit-close {
  font-size: 1.15rem;
  padding: 0 0.5rem;
  line-height: 1;
}

.oden-edit-textarea {
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  outline: none;
  resize: none;
  padding: 1rem;
  font: 0.85rem/1.5 'JetBrains Mono', ui-monospace, monospace;
  tab-size: 2;
}
