.community-dialog {
  width: min(94vw, 580px); max-height: 88dvh; padding: 0;
  border: 1px solid #6f4a60; border-radius: 20px; color: #fff1f6; background: #261b24;
  box-shadow: 0 16px 70px #100810a6; font-family: inherit;
}
.community-dialog::backdrop { background: #100810b8; }
.community-heading {
  position: sticky; top: 0; z-index: 1; background: #261b24;
  padding: 12px var(--ui-modal-padding); border-bottom: 1px solid #503846;
  display: flex; justify-content: space-between; align-items: center; gap: var(--ui-control-padding);
}
.community-heading h2 { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.community-content { padding: var(--ui-modal-padding); }
.community-stack { display: grid; gap: var(--ui-form-gap); }
.community-card {
  min-width: 0; padding: var(--ui-card-padding); border: 1px solid #573c4d; border-radius: 14px; background: #1d171f;
  overflow-wrap: anywhere;
}
.community-card h3, .community-card h4 { margin: 0 0 .45rem; }
.community-card h4 { margin-top: .75rem; }
.community-card p { margin: 0 0 .6rem; }
.community-copy { white-space: pre-wrap; }
.community-field { display: grid; gap: var(--ui-inline-gap); min-width: 0; color: #eed5e2; font-size: .9rem; }
.community-field :is(input,textarea,select) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; font: inherit;
  color: #fff1f6; background: #1b141d; padding: 10px var(--ui-control-padding); border: 1px solid #66475b; border-radius: 9px;
}
.community-field :is(input,textarea,select):focus-visible {
  outline: 2px solid #ffb6d2; outline-offset: 2px;
}
.community-field textarea { resize: vertical; }
.community-button {
  min-height: 42px; border: 1px solid #745368; border-radius: 10px; padding: 7px 12px;
  font: inherit; font-size: .87rem; background: #362634; color: #ffc1dc; cursor: pointer;
}
.community-primary { background: #ffb3d3; border-color: #ffb3d3; color: #24151e; font-weight: 650; }
.community-button:disabled { opacity: .55; cursor: default; }
.lore-pinned { display: flex; align-items: center; gap: var(--ui-inline-gap); min-height: 44px; }
.lore-pinned input[type="checkbox"] { width: auto; min-height: auto; accent-color: #ffb3d3; }
.lore-search-preview { margin-top: var(--ui-form-gap); }
.community-actions, .community-tags { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.community-tags:not(:empty) { margin: 4px 0 8px; }
.community-tags :is(span,button) {
  color: #ffc1dc; font-size: .8rem; max-width: 100%; overflow-wrap: anywhere;
  display: inline-block; border: 1px solid #69465a; border-radius: 100px; padding: 4px 9px;
}
.community-tags button { min-height: 30px; }
.community-byline,.community-subtle { color: #d7adbf; font-size: .81rem; overflow-wrap: anywhere; }
.community-card-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  min-width: 0; gap: var(--ui-inline-gap, 8px);
}
.community-card-heading > :first-child { min-width: 0; overflow-wrap: anywhere; }
.community-player-count {
  display: inline-flex; flex: none; align-items: center; gap: 4px;
  border-radius: 999px; padding: 3px 7px;
  background: #4a2d3e; color: #ffc1dc;
  font-size: .72rem; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.community-player-count svg {
  width: 13px; height: 13px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.hero-card-copy .community-card-heading > strong {
  font-size: 16px; line-height: 1.25; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.community-status { color: #f2b1d0; font-size: .88rem; }
.community-status:empty { display: none; }
#catalog-community-actions { margin: 0 0 var(--ui-control-padding); }
#panel-saves .catalog-heading { align-items: flex-start; }
#panel-saves .slot-list { margin-top: var(--ui-control-padding); }
.story-settings-title {
  appearance: none; background: none; border: 0; color: inherit; padding: 0;
  cursor: pointer; font: inherit; text-align: start; overflow-wrap: anywhere;
}
.story-settings-title:hover { text-decoration: underline; }
#active-story-settings:not([hidden]) { justify-self: start; min-height: 36px; }
.saved-story-heading { display: flex; align-items: center; gap: var(--ui-control-padding); margin-bottom: var(--ui-inline-gap); }
.saved-story-heading h3, .saved-story-heading p { margin: 0; }
.saved-story-heading > :last-child { min-width: 0; }
.saved-story-avatar {
  flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center;
  object-fit: cover; border-radius: 10px; background: #482e41; color: #ffc1dc;
}
.story-options { display: grid; gap: var(--ui-inline-gap); }
.story-option {
  min-width: 0; padding: 0 var(--ui-card-padding); border: 1px solid #624557;
  border-radius: 12px; background: #211923; overflow-wrap: anywhere;
}
.story-option > summary {
  position: relative; display: grid; gap: 4px; padding: 12px 24px 12px 0; cursor: pointer;
  list-style: none;
}
.story-option > summary::-webkit-details-marker { display: none; }
.story-option > summary::after { content: '›'; position: absolute; right: 0; top: 12px; color: #edb3d0; }
.story-option[open] > summary::after { transform: rotate(90deg); }
.story-option[open] { padding-bottom: var(--ui-card-padding); }
.story-option > .community-stack { margin-top: var(--ui-inline-gap); }
.story-option-row, .story-option-toggle { display: flex; align-items: center; gap: var(--ui-inline-gap); }
.story-option-row { flex-wrap: wrap; padding-top: var(--ui-control-padding); }
.story-option-row img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; }
.story-option-row > :first-child:not(img), .story-option-reference > div { min-width: 0; flex: 1 1 80px; }
.story-option-reference small { display: block; }
.story-option-toggle input { accent-color: #ffb3d3; }
.story-option [hidden] { display: none !important; }
@media (max-width: 600px) {
  .community-dialog:has(.story-options) {
    position: fixed; inset: auto 0 0; margin: auto auto 0; width: 100%; max-width: 100%;
    box-sizing: border-box; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.hero-card-copy .community-subtle, .card-text .community-subtle {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.lore-nav { margin: 0 0 var(--ui-form-gap); }
.lore-nav [aria-pressed="true"] { background: #593448; color: #ffe4ef; border-color: #b17a98; }
.lore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.lore-tile, .lore-cover-picker { min-width: 0; }
.lore-cover-picker { display: grid; gap: var(--ui-inline-gap); justify-items: start; }
.lore-cover-picker > label, .lore-cover-picker > .lore-cover { width: 100%; }
.lore-cover-picker p { margin: 0; }
.lore-cover {
  overflow: hidden; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 12px; background: #291f29;
}
.lore-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lore-tile .lore-cover { margin-bottom: var(--ui-control-padding); }
.lore-tile .lore-cover img { object-fit: cover; }
.lore-cover[hidden], .lore-cover-picker [hidden] { display: none; }
.lore-search input {
  flex: 1 1 160px; min-width: 0; min-height: 42px; border: 1px solid #66475b;
  border-radius: 10px; padding: 8px 11px; font: inherit; color: #fff1f6; background: #1b141d;
}
.lore-review { margin-top: var(--ui-form-gap); }
.lore-sections { border:1px solid #573c4d; border-radius:14px; background:#1d171f; }
.lore-section + .lore-section { border-top:1px solid #573c4d; }
.lore-section > summary {
  display:flex; align-items:center; justify-content:space-between; gap:var(--ui-inline-gap);
  min-height:48px; padding:var(--ui-inline-gap) var(--ui-card-padding);
  list-style:none; cursor:pointer; font-weight:600; overflow-wrap:anywhere;
}
.lore-section > summary::-webkit-details-marker { display:none; }
.lore-section > summary:focus-visible { outline-offset:-3px; border-radius:12px; }
.lore-section > summary::after {
  content:""; flex:0 0 7px; height:7px; margin-right:3px; color:#ffb3d3;
  border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg);
}
.lore-section[open] > summary { color:#ffb3d3; }
.lore-section[open] > summary::after { transform:rotate(225deg); }
.lore-section-body { min-width:0; padding:0 var(--ui-card-padding) var(--ui-card-padding); overflow-wrap:anywhere; }
