.anthology-dialog {
  box-sizing: border-box;
  width: min(680px, calc(100vw - 28px));
  max-width: 100%;
  max-height: min(85dvh, 860px);
  margin: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--xp-ink, #302735);
  background: var(--xp-paper, #fffaf1);
  border: 1px solid var(--xp-line, #c5b995);
  border-radius: 18px;
  box-shadow: 0 24px 85px #09061273;
  text-align: start;
}
.anthology-dialog::backdrop { background: #120e1bbb; }
.anthology-head {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 16px clamp(16px, 5vw, 32px) 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--xp-paper);
  border-bottom: 1px solid var(--xp-line);
}
.anthology-caption, .anthology-hint, .anthology-entry-link small, .anthology-shelf small {
  color: var(--xp-muted);
}
.anthology-head h2 {
  margin: 0;
  font-family: 'Aref Ruqaa', Amiri, serif;
  font-size: clamp(25px, 4.8vw, 36px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.anthology-caption { margin: 0; font-size: .81rem; }
.anthology-dialog button, .anthology-dialog summary {
  min-height: 42px;
  padding: 6px 14px;
  color: var(--xp-ink);
  background: var(--xp-bg);
  border: 1px solid var(--xp-line);
  border-radius: 9px;
  font: inherit;
  cursor: pointer;
}
.anthology-dialog button:hover, .anthology-dialog summary:hover, .anthology-entry-link:hover { color: var(--xp-gold); border-color: var(--xp-gold); }
.anthology-dialog button:disabled { opacity: .42; cursor: default; }
.anthology-dialog :is(button, a, input, summary):focus-visible { outline: 2px solid var(--xp-gold); outline-offset: 2px; }
.anthology-dialog .anthology-close { flex: 0 0 42px; height: 42px; padding: 0; border-radius: 50%; font: 27px/1 sans-serif; }
.anthology-body { padding: 16px clamp(16px, 5vw, 32px); }
.anthology-status { margin: 0; padding: 0 clamp(16px, 5vw, 32px) 16px; color: var(--xp-ink); }
.anthology-status:empty { padding: 0; }
.anthology-hint, .anthology-pending { margin: 0 0 14px; line-height: 1.8; }
.anthology-pending { padding-inline-start: 12px; border-inline-start: 3px solid var(--xp-gold); }
.anthology-shelves { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); margin-bottom: 18px; }
.anthology-dialog .anthology-shelf { display: grid; gap: 3px; text-align: start; padding: 12px 16px; border-inline-start: 3px solid var(--xp-gold); }
.anthology-shelf strong { overflow-wrap: anywhere; }
.anthology-form { display: flex; align-items: end; gap: 10px; }
.anthology-form label { flex: 1; min-width: 0; display: grid; gap: 5px; }
.anthology-dialog input {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 7px 12px;
  border: 1px solid var(--xp-line);
  border-radius: 8px;
  background: var(--xp-paper);
  color: var(--xp-ink);
  font: inherit;
}
.anthology-actions, .anthology-order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.anthology-dialog .anthology-primary { border-color: var(--xp-gold); }
.anthology-entries { padding-inline-start: 1.5rem; margin: 14px 0; }
.anthology-entries > li { padding: 10px 3px; border-bottom: 1px solid var(--xp-line); }
.anthology-entries > li::marker { color: var(--xp-muted); font-variant-numeric: tabular-nums; }
.anthology-entry-link { display: inline-grid; gap: 3px; padding: 4px; color: var(--xp-ink); text-decoration: none; }
.anthology-entry-link strong { overflow-wrap: anywhere; }
.anthology-entry-link small { font-size: .81rem; }
.anthology-order { margin-top: 6px; }
.anthology-order button { min-width: 40px; padding: 4px 8px; background: transparent; }
.anthology-edit { margin-top: 16px; }
.anthology-edit summary { width: fit-content; }
.anthology-edit[open] > .anthology-form, .anthology-delete, .anthology-copy { margin-top: 12px; }
.anthology-delete p { margin: 8px 0; }
@media (max-width: 540px) {
  .anthology-dialog { width: calc(100vw - 14px); max-height: 91dvh; border-radius: 14px; }
  .anthology-shelves { grid-template-columns: 1fr; }
  .anthology-actions button { flex: 1 1 auto; }
}
