.story-workspace {
  overflow-wrap: anywhere;
}
.story-workspace p {
  line-height: 1.8;
  margin-top: 12px;
}
.story-workspace label,
.story-editor label {
  display: block;
  font-size: 0.875rem;
  margin: 16px 0 8px;
}
.story-workspace input,
.story-workspace select,
.story-editor input:not([type="checkbox"]),
.story-editor select,
.story-editor textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: inherit;
  background: var(--background);
}
.story-filters {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.story-filters label {
  margin: 0;
}
.story-filters input,
.story-filters select {
  margin-top: 4px;
}
.story-events-entry[hidden] {
  display: none;
}
.story-events-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.story-events-entry strong {
  font: 600 1.2rem var(--font-serif);
}
.story-events-entry p {
  margin: 2px 0 0;
  font-size: 0.875rem;
}
.story-events-entry a {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  text-decoration: none;
}
.story-events-entry a:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.story-timeline {
  min-width: 0;
  margin: 8px 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.story-timeline[hidden] {
  display: none;
}
.story-timeline-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
}
.story-timeline-heading h2 {
  font: 600 1.45rem var(--font-serif);
}
.story-timeline-heading p,
.story-timeline-help {
  margin: 0;
}
.story-timeline-help {
  font-size: 0.875rem;
}
.story-timeline-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 4px;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}
.story-timeline-scroll:focus-visible,
.story-timeline-point:focus-visible,
.story-timeline-add:focus-visible,
.story-timeline-remove:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.story-timeline-track {
  position: relative;
  display: flex;
  width: max-content;
  min-width: 100%;
  list-style: none;
  margin: 0;
  padding: 0 6px;
}
.story-timeline-track::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 28px;
  right: 28px;
  height: 1px;
  background: var(--primary);
}
.story-timeline-event-item {
  position: relative;
  flex: 0 0 150px;
  min-width: 0;
}
.story-timeline-gap {
  position: relative;
  z-index: 2;
  flex: 0 0 44px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}
.story-timeline-add,
.story-timeline-remove {
  display: block;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.story-timeline-add {
  height: 44px;
  margin-top: 20px;
}
.story-timeline-remove {
  margin: 0 auto;
}
.story-timeline-add:hover,
.story-timeline-remove:hover {
  background: var(--muted);
}
.story-timeline-point {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 28px 20px auto;
  justify-items: center;
  align-items: center;
  width: 100%;
  min-height: 96px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.story-timeline-point[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--muted);
}
.story-timeline-period {
  font-size: 0.85rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.story-timeline-dot {
  position: relative;
  z-index: 3;
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--background);
}
.story-timeline-point[aria-pressed="true"] .story-timeline-dot {
  background: var(--primary);
}
.story-timeline-event {
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.story-timeline-insert-hint[hidden] {
  display: none;
}
.story-timeline-insert-hint {
  font-size: 0.875rem;
}
.story-split {
  display: grid;
  gap: 12px;
  align-items: start;
}
.story-catalog,
.story-detail {
  min-width: 0;
}
.story-detail {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.story-detail-placeholder {
  color: var(--muted-foreground);
}
.story-detail-back {
  display: none;
}
.story-workspace a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.story-table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  margin-top: 8px;
}
.story-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}
.story-table caption {
  text-align: left;
  padding: 8px 0;
  color: var(--muted-foreground);
}
.story-table th,
.story-table td {
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
  font-weight: 400;
}
.story-table th:last-child,
.story-table td:last-child {
  border-right: 0;
}
.story-table thead th {
  height: 36px;
  color: var(--muted-foreground);
}
.story-table tbody tr:hover,
.story-table tr[data-selected="true"] {
  background: var(--muted);
}
.story-table tr[data-selected="true"] > th {
  box-shadow: inset 3px 0 var(--primary);
}
.story-table-value {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-table-tags {
  display: flex;
  gap: 4px;
}
.story-table-tags span {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--muted);
}
.story-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.story-row-actions button,
.story-row-actions a {
  min-height: 44px;
  min-width: 44px;
  padding: 4px 8px;
  background: transparent;
  color: inherit;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.story-table-scroll:focus-visible,
.story-table :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.story-table .story-card-pick {
  display: block;
  width: 100%;
  text-align: left;
  font: 500 0.875rem var(--font-sans);
  color: inherit;
  background: none;
  border: 0;
  padding: 4px 0;
  min-height: 44px;
  cursor: pointer;
}
.story-panel,
.story-editor {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.story-editor h2 {
  font: 600 1.35rem var(--font-serif);
  overflow-wrap: anywhere;
}
.story-editor [data-testid="story-card-category"] {
  margin: 4px 0 16px;
  color: var(--muted-foreground);
}
.story-more {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 8px;
}
.story-more summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}
.story-timeline-meta {
  margin-top: 16px;
}
.story-timeline-meta p {
  font-size: 0.85rem;
  margin-top: 4px;
}
.story-body {
  min-height: 340px;
  margin: 0 0 16px;
}
.story-editor-help {
  font-size: 0.875rem;
  margin: 12px 0;
}
.story-editor .editor-body-region {
  margin-top: 12px;
}
.story-body p {
  margin: 12px 0;
}
.story-body h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin: 18px 0;
}
.story-body ul {
  list-style: disc;
  padding-left: 24px;
}
.story-body b,
.story-body strong {
  font-weight: 700;
}
.story-body:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.story-fields {
  display: grid;
  gap: 4px 16px;
}
.story-people-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 8px;
  list-style: none;
  min-width: 0;
}
.story-people-tags li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 44px;
  padding-left: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--muted);
}
.story-people-tags li span {
  overflow-wrap: anywhere;
  min-width: 0;
}
.story-people-tags button,
.story-people-entry button,
.story-people-suggestions button {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.story-people-tags button {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
}
.story-people-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.story-people-entry input {
  flex: 1 1 160px;
  min-width: 0;
}
.story-people-entry button {
  flex: 0 0 auto;
  padding: 0 14px;
}
.story-people-suggestions {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  margin: 6px 0 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  list-style: none;
}
.story-people-suggestions[hidden] {
  display: none;
}
.story-people-suggestions button {
  width: 100%;
  text-align: left;
  padding: 8px 12px;
}
.story-people-suggestions button[aria-selected="true"],
.story-people-suggestions button:hover {
  background: var(--muted);
}
.story-people-tags button:focus-visible,
.story-people-entry button:focus-visible,
.story-people-entry input:focus-visible,
.story-people-suggestions button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.story-field [data-testid="story-related-people-status"] {
  min-height: 1.5em;
  margin: 4px 0 0;
  font-size: 0.85rem;
}
.story-check {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.story-check input {
  width: 22px;
  height: 22px;
  min-height: 22px;
  flex-shrink: 0;
}
.story-editor img {
  width: 100%;
  height: auto;
  margin-top: 16px;
}
.story-editor .editor-image-stage img {
  margin-top: 0;
}
html[data-editor-input="desktop"]
  .story-editor
  .editor-image-stage
  [data-testid="editor-media-edit"] {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.story-editor .story-image-credit {
  font-size: 0.8rem;
}
.story-editor .story-image-credit a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}
.story-dialog {
  width: min(92vw, 650px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.8;
}
.story-dialog::backdrop {
  background: rgb(0 0 0 / 60%);
}
.story-dialog h2 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
}
.story-dialog p {
  margin-top: 14px;
  overflow-wrap: anywhere;
}
.story-dialog button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: inherit;
  font: inherit;
}
.story-dialog :focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.story-dialog [hidden] {
  display: none !important;
}
.story-dialog .story-category-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--background);
  color: inherit;
  padding: 10px;
  font: inherit;
  margin-top: 12px;
}
@media (min-width: 768px) {
  .story-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .story-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .story-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 767px) {
  .story-timeline {
    padding: 8px 0;
  }
  .story-timeline-event-item {
    flex-basis: 150px;
  }
  body:has(.story-split[data-detail-open="true"]) {
    overflow: hidden;
  }
  .story-split[data-detail-open="true"] .story-catalog {
    display: none;
  }
  .story-split:not([data-detail-open="true"]) .story-detail {
    display: none;
  }
  .story-split[data-detail-open="true"] .story-detail {
    position: fixed;
    inset: 0;
    z-index: 100;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--background);
    border: 0;
    border-radius: 0;
  }
  .story-detail {
    padding: 12px;
  }
  .story-detail-back {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 44px;
    width: 100%;
    text-align: left;
    border: 0;
    background: var(--background);
    color: inherit;
    font: inherit;
  }
}
