.detail.edit-mode {
  grid-template-columns: 400px 1fr;
}
@media (max-width: 900px) {
  .detail.edit-mode { grid-template-columns: 1fr; }
}

.edit-info {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.edit-info .field {
  margin-bottom: 16px;
}

.edit-info label {
  display: block;
  font-size: 11px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.edit-info input[type="text"],
.edit-info textarea {
  width: 100%;
  background: #121212;
  border: 1px solid #3f3f3f;
  color: #f1f1f1;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
}

.edit-info input[type="text"]:focus,
.edit-info textarea:focus {
  outline: none;
  border-color: #ff0000;
}

.edit-info textarea {
  resize: vertical;
  min-height: 100px;
}

.edit-info .selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.edit-info .chip {
  background: #ff0000;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edit-info .chip .x {
  cursor: pointer;
  font-weight: bold;
  opacity: .8;
}

.edit-info .chip .x:hover {
  opacity: 1;
}

.tag-input-wrapper {
  position: relative;
}

.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #181818;
  border: 1px solid #3f3f3f;
  border-radius: 6px;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.tag-suggestions.visible {
  display: block;
}

.tag-suggestion {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.tag-suggestion:hover,
.tag-suggestion.create {
  background: #3f3f3f;
}

.tag-suggestion.create {
  color: #ff5555;
}

.tag-suggestion.empty {
  color: #666;
  cursor: default;
  font-style: italic;
}

.tag-suggestion.empty:hover {
  background: transparent;
}

.url-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.url-row input {
  flex: 1;
}

button.subtle {
  background: transparent;
  color: #888;
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.subtle:hover {
  background: #3f3f3f;
  color: #ff5555;
}

button.primary {
  background: #ff0000;
  width: 100%;
  padding: 14px;
  font-weight: 500;
  margin-top: 12px;
}

button.primary:hover {
  background: #cc0000;
}

button.primary:disabled {
  background: #555;
  cursor: not-allowed;
}

.date-hint {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
}

.error-msg {
  color: #ff5555;
  font-size: 12px;
  margin-top: 4px;
}

input.invalid {
  border-color: #ff5555 !important;
}

.status-msg {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

.status-msg.ok {
  color: #66ff88;
}

.status-msg.err {
  color: #ff5555;
}

.edit-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-gallery h3 {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 12px;
}

#editExistingMedia,
#editNewMediaList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-media-card {
  background: #1a1a1a;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.edit-media-preview {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-media-preview img,
.edit-media-preview video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.edit-media-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.edit-media-info .filename {
  font-size: 13px;
  color: #f1f1f1;
  word-break: break-all;
}

.edit-media-info button {
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 12px;
}

.media-zone {
  background: #121212;
  border: 2px dashed #3f3f3f;
  border-radius: 8px;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s;
}

.media-zone:hover,
.media-zone.drag {
  border-color: #ff0000;
}

.media-placeholder {
  color: #666;
  text-align: center;
  padding: 20px;
}

.media-placeholder .big {
  font-size: 48px;
  margin-bottom: 12px;
}

.edit-info button {
  background: #3f3f3f;
  color: #f1f1f1;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: background .15s, color .15s;
}

.edit-info button:hover {
  background: #555;
}

.edit-info button.subtle {
  background: transparent;
  color: #888;
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
}

.edit-info button.subtle:hover {
  background: #3f3f3f;
  color: #ff5555;
}

.edit-info button.primary {
  background: #ff0000;
  width: 100%;
  padding: 14px;
  font-weight: 500;
  margin-top: 12px;
}

.edit-info button.primary:hover {
  background: #cc0000;
}

.edit-info button.primary:disabled {
  background: #555;
  cursor: not-allowed;
}

.edit-info #editAddUrlBtn {
  background: #3f3f3f;
  color: #f1f1f1;
  padding: 8px 14px;
  font-size: 13px;
  width: auto;
}

.edit-info #editAddUrlBtn:hover {
  background: #555;
}
