:root {
  --edit-mode-border-color: #2563eb;
}

.edit-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-controls button {
  font-size: 0.875rem;
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--edit-mode-border-color);
  background: transparent;
  color: var(--edit-mode-border-color);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.edit-controls button:hover,
.edit-controls button:focus-visible {
  background-color: var(--edit-mode-border-color);
  color: #ffffff;
  outline: none;
}

.edit-controls button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(37, 99, 235, 0.1);
  color: rgba(37, 99, 235, 0.7);
}

.edit-controls button.save-button {
  background: var(--edit-mode-border-color);
  color: #ffffff;
  border-color: var(--edit-mode-border-color);
}

.edit-controls button.save-button:hover,
.edit-controls button.save-button:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

[data-edit-only] {
  display: none !important;
  --edit-mode-display: inline-flex;
}

[data-edit-only][data-edit-display="block"] {
  --edit-mode-display: block;
}

[data-edit-only][data-edit-display="flex"] {
  --edit-mode-display: flex;
}

[data-edit-only][data-edit-display="grid"] {
  --edit-mode-display: grid;
}

html.edit-mode-active [data-edit-only],
body.edit-mode-active [data-edit-only] {
  display: var(--edit-mode-display) !important;
}

html.edit-mode-active,
body.edit-mode-active {
  box-shadow: inset 0 0 0 3px var(--edit-mode-border-color);
}

.edit-fallback-header {
  width: 100%;
  background: rgba(17, 24, 39, 0.9);
  color: #ffffff;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: flex-end;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.edit-fallback-active {
  padding-top: 3.5rem;
}

.edit-fallback-header .edit-controls button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.8);
}

.edit-fallback-header .edit-controls button:hover,
.edit-fallback-header .edit-controls button:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
}

@media (max-width: 768px) {
  .edit-controls {
    gap: 0.4rem;
  }

  .edit-controls button {
    font-size: 0.8rem;
    padding: 0.35rem 0.7rem;
  }
}
