.entity-merge-dialog { width: min(680px,calc(100vw - 32px)); max-height: min(86dvh,850px); }
.entity-merge-dialog .entity-merge-body { min-width: 0; }
.entity-merge-body h2 { font-size: 1.125rem; line-height: 1.6; }
.entity-merge-body h3 { font-size: .95rem; line-height: 1.6; margin: 0 0 8px; }
.entity-merge-body p,.entity-merge-body li,.entity-merge-body label,.entity-merge-body button { font-size: .9rem; line-height: 1.65; }
.entity-merge-body p { margin: 10px 0; }
.entity-merge-note,.entity-merge-entity small { color: var(--muted); font-size: .82rem!important; }
.entity-merge-route { display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr); align-items: center; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.entity-merge-entity { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.entity-merge-entity > span { color: var(--muted); font-size: .78rem; }
.entity-merge-entity strong { color: var(--ink); font-size: 1rem; }
.entity-merge-arrow { color: var(--brand); font-weight: 700; text-align: center; }
.entity-merge-counts { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entity-merge-counts > div { display: flex; align-items: baseline; gap: 8px; font-size: .85rem; }
.entity-merge-counts dt { color: var(--muted); }
.entity-merge-counts dd { margin: 0; color: var(--ink); font-weight: 700; }
.entity-merge-search { margin: 14px 0 8px; }
.entity-merge-search label { display: block; margin-bottom: 5px; font-weight: 700; }
.entity-merge-search > div { display: flex; align-items: center; gap: 8px; }
.entity-merge-search input { min-width: 0; width: 100%; }
.entity-merge-search button { flex: 0 0 auto; min-height: 44px; }
.entity-merge-results { min-height: 160px; }
.entity-merge-candidates,.entity-merge-history { list-style: none; margin: 0; padding: 0; }
.entity-merge-candidates > li + li,.entity-merge-history > li + li { border-top: 1px solid var(--line); }
.entity-merge-candidates button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 12px 8px; min-height: 56px; border: 0; border-radius: 4px; color: var(--ink); background: var(--panel); text-align: left; cursor: pointer; }
.entity-merge-candidates button > span:first-child { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.entity-merge-candidates small,.entity-merge-history small { display: block; color: var(--muted); font-size: .8rem; }
.entity-merge-candidates button:hover { background: var(--bg); }
.entity-merge-candidates button:disabled { opacity: .6; cursor: default; }
.entity-merge-dialog button:focus-visible,.entity-merge-dialog input:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.entity-merge-pagination { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: .8rem; }
.entity-merge-pagination button { min-height: 44px; }
.entity-merge-empty { display: grid; place-items: center; min-height: 140px; padding: 18px; color: var(--muted); text-align: center; }
.entity-merge-actions { flex-wrap: wrap; gap: 8px; }
.entity-merge-actions > span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; min-width: 0; flex: 1 1 auto; }
.entity-merge-actions button { min-height: 44px; white-space: normal; word-break: normal; }
.entity-merge-prices { margin: 18px 0 8px; padding: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.entity-merge-prices fieldset { margin: 10px 0 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); min-width: 0; }
.entity-merge-prices legend { font-size: .88rem; font-weight: 700; padding: 0 8px 0 0; overflow-wrap: anywhere; }
.entity-merge-prices label { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; min-height: 44px; padding: 8px 0; cursor: pointer; }
.entity-merge-prices input[type="radio"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--brand); }
.entity-merge-prices label > span { min-width: 0; overflow-wrap: anywhere; }
.entity-merge-history > li { display: grid; gap: 7px; padding: 14px 0; }
.entity-merge-history strong { font-size: .9rem; overflow-wrap: anywhere; }
.entity-merge-history button { justify-self: start; min-height: 44px; }
.entity-merge-source { border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.entity-merge-source > summary { min-height: 44px; padding: 10px 12px; font-size: .82rem; cursor: pointer; }
.entity-merge-source > summary:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.entity-merge-source > div { padding: 0 12px 12px; }
.entity-merge-source-fields { margin: 8px 0 0; }
.entity-merge-source-fields > div { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .82rem; line-height: 1.6; }
.entity-merge-source-fields dt { color: var(--muted); }
.entity-merge-source-fields dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.entity-merge-undo-note { margin-top: 12px; }
.entity-merge-undo-note ul,.entity-merge-warnings { padding-left: 1.4em; }
.entity-merge-error { margin-bottom: 0; }
@media (max-width:600px) {
  .entity-merge-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 28px); }
  .entity-merge-dialog .entity-merge-body { padding: 18px 16px; }
  .entity-merge-route { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .entity-merge-arrow { text-align: left; transform: rotate(90deg); width: 24px; }
  .entity-merge-dialog .entity-merge-actions { padding: 12px 16px; }
  .entity-merge-actions > span { flex: 1 1 100%; }
  .entity-merge-actions > span > .primary-button { flex: 1 1 auto; }
  .entity-merge-prices { padding: 12px; }
}
@media (forced-colors:active) {
  .entity-merge-candidates button,.entity-merge-prices { border: 1px solid CanvasText; }
  .entity-merge-arrow { color: LinkText; }
}

.entity-editor-notice { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .85rem; line-height: 1.65; overflow-wrap: anywhere; }
.entity-editor-notice p { margin: 0; }
.entity-editor-notice .text-button { min-height: 44px; margin-top: 4px; }
