.service-stories > header,
.story-editor header,
.story-editor footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.service-stories h2,
.story-editor h2 {
  margin: 0;
  font-size: 21px;
}
.service-stories > header > button {
  width: auto;
  min-height: 44px;
  flex-shrink: 0;
}
.story-editor header > button {
  width: 44px;
  min-height: 44px;
  flex: 0 0 44px;
  padding: 8px;
}
.story-editor footer > button {
  width: auto;
  min-height: 44px;
  padding: 8px 12px;
}
.story-editor header h2 {
  white-space: nowrap;
  font-size: 20px;
}
.service-stories header p {
  margin: 4px 0 8px;
}
.stories-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.stories-filters button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #393940;
  background: #000;
  border-radius: 10px;
  color: #a5a5b5;
}
.stories-filters button.selected {
  color: #ff681e;
  border-color: #ff681e;
  background: #1c1c21;
}
.stories-list {
  display: grid;
  gap: 8px;
}
.story-management-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: #1c1c21;
  border: 1px solid #303038;
  border-radius: 12px;
  padding: 8px 12px;
  color: #f4f4fa;
  min-height: 64px;
  width: 100%;
}
.story-management-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.story-management-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-management-row small {
  display: block;
  margin-top: 4px;
  color: #a5a5b5;
}
.story-thumbnail {
  width: 44px;
  height: 54px;
  border-radius: 8px;
  background: #101014;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.story-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-editor {
  background: #1c1c21;
  color: #f4f4fa;
  border: 1px solid #393940;
  border-radius: 16px;
  padding: 16px;
  width: min(780px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
}
.story-editor::backdrop {
  background: #000b;
}
.story-editor-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  margin-top: 12px;
}
.story-editor-fields {
  display: grid;
  gap: 10px;
  align-content: start;
}
.story-editor label {
  display: grid;
  gap: 4px;
}
.story-editor label small {
  font-size: 12px;
  color: #a5a5b5;
}
.story-editor input,
.story-editor select,
.story-editor textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #393940;
  background: #101014;
  color: #f4f4fa;
  border-radius: 10px;
  font: inherit;
}
.story-editor input[type='file'] {
  font-size: 13px;
  padding: 7px;
}
.story-editor input::file-selector-button {
  min-height: 30px;
  background: #1c1c21;
  color: #f4f4fa;
  border: 0;
  border-radius: 6px;
}
.story-editor footer {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.story-preview {
  aspect-ratio: 9/16;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
  display: grid;
  place-items: center;
  align-self: start;
}
.story-preview > img,
.story-preview > video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-preview > div {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 5px #000;
}
.story-preview p {
  white-space: pre-wrap;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.story-preview-action {
  display: block;
  padding: 8px;
  background: #ff681e;
  color: #000;
  border-radius: 8px;
  text-shadow: none;
}
.stories-error {
  color: #ff7770;
  font-size: 14px;
  margin: 8px 0;
}
.stories-error:empty {
  display: none;
}
.stories-more {
  margin-top: 10px;
}
@media (max-width: 560px) {
  .story-editor-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .story-preview {
    width: 150px;
    margin: auto;
  }
  .story-editor {
    padding: 12px;
  }
  .service-stories > header {
    align-items: flex-start;
  }
  .service-stories header p {
    font-size: 13px;
    max-width: 220px;
  }
}
