/* One calm, compact documentation surface for every Biblio analysis. */
details.analysis-help { border:1px solid var(--border); border-radius:12px; background:var(--bg-card); margin:18px 0; color:var(--text); padding:0; box-shadow:none; min-width:0; }
.analysis-help > summary { display:flex; align-items:center; gap:12px; padding:14px 18px; cursor:pointer; list-style:none; }
.analysis-help > summary::-webkit-details-marker { display:none; }
.analysis-help > summary::marker { content:""; }
.analysis-help .ah-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:6px 16px; min-width:0; }
.analysis-help > summary b { font-size:13px; font-weight:600; line-height:1.5; }
.analysis-help > summary small { font-size:12px; color:var(--text-secondary,var(--text-muted)); font-weight:400; }
.analysis-help .ah-icon { width:25px; height:25px; flex:0 0 25px; display:grid; place-items:center; border:1px solid var(--border); border-radius:50%; color:var(--accent); font:600 13px/1 sans-serif; }
.analysis-help .ah-chevron { width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin:0 3px 4px auto; color:var(--text-muted); flex-shrink:0; }
.analysis-help[open] > summary .ah-chevron { transform:rotate(225deg); margin-bottom:0; }
.analysis-help .ah-body { padding:0 18px 18px; border-top:1px solid var(--border); font-size:13px; line-height:1.65; }
.analysis-help .ah-tabs { display:flex; gap:4px 18px; flex-wrap:wrap; border-bottom:1px solid var(--border); margin:0 0 16px; }
.analysis-help .ah-tabs button { appearance:none; background:none; border:0; border-bottom:2px solid transparent; border-radius:0; box-shadow:none; font-family:inherit; font-weight:500; line-height:1.5; font-size:12px; color:var(--text-secondary,var(--text-muted)); padding:12px 0 10px; cursor:pointer; }
.analysis-help .ah-tabs button[aria-selected="true"] { border-bottom-color:var(--accent); color:var(--accent); }
.analysis-help [role="tabpanel"] { min-width:0; }
.analysis-help [role="tabpanel"][hidden] { display:none; }
.analysis-help :is(button,summary,a,[role="tabpanel"]):focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:3px; }
.analysis-help .ah-caption { font-size:12px; line-height:1.5; color:var(--text-secondary,var(--text-muted)); margin:0 0 16px; max-width:80ch; overflow-wrap:anywhere; }
.analysis-help .ah-coverage { max-width:880px; margin-bottom:14px; }
.analysis-help .ah-coverage-row { display:grid; grid-template-columns:minmax(140px,1.2fr) minmax(50px,1fr) auto auto; gap:16px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); font-size:12px; }
.analysis-help .ah-progress { background:var(--bg-elevated); height:4px; border-radius:4px; overflow:hidden; }
.analysis-help .ah-progress i { height:100%; display:block; background:var(--accent); opacity:.65; border-radius:inherit; }
.analysis-help .ah-count { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.analysis-help .ah-count small,.analysis-help .ah-missing { font-size:11px; color:var(--text-secondary,var(--text-muted)); }
.analysis-help .ah-missing { text-align:right; }
.analysis-help .ah-definitions { margin:0; max-width:940px; }
.analysis-help .ah-definitions > div { display:grid; grid-template-columns:155px minmax(0,1fr); gap:20px; padding:12px 0; border-bottom:1px solid var(--border); }
.analysis-help .ah-definitions > div:first-child { padding-top:0; }
.analysis-help .ah-definitions > div:last-child { border-bottom:0; padding-bottom:0; }
.analysis-help .ah-definitions dt { font-size:12px; line-height:1.65; font-weight:600; overflow-wrap:anywhere; }
.analysis-help .ah-definitions dd { margin:0; font-size:13px; line-height:1.65; color:var(--text-secondary,var(--text-muted)); overflow-wrap:anywhere; max-width:80ch; }
.analysis-help .ah-links { display:flex; gap:8px; flex-wrap:wrap; }
.analysis-help .ah-links a { display:inline-flex; align-items:center; gap:8px; color:var(--accent); text-decoration:none; border:1px solid var(--border); border-radius:7px; padding:7px 10px; font-size:12px; line-height:1.5; overflow-wrap:anywhere; max-width:100%; }
.analysis-help .ah-links a:hover { background:var(--bg-elevated); border-color:var(--accent); }
.analysis-help .ah-body details { margin-top:14px; font-size:12px; }
.analysis-help .ah-body details summary { font-weight:600; cursor:pointer; }
.analysis-help .ah-body table :is(th,td) { font-size:12px; padding:8px 10px; }
.analysis-help .ah-body p { overflow-wrap:anywhere; }
@media (max-width:650px) {
  .analysis-help > summary { padding:12px 14px; }
  .analysis-help .ah-heading { display:block; }
  .analysis-help .ah-heading small { display:block; margin-top:2px; }
  .analysis-help .ah-body { padding:0 14px 16px; }
  .analysis-help .ah-coverage-row { grid-template-columns:minmax(0,1fr) auto; gap:5px 12px; }
  .analysis-help .ah-progress { display:none; }
  .analysis-help .ah-missing { grid-column:2; }
  .analysis-help .ah-definitions > div { grid-template-columns:1fr; gap:4px; }
}
/* Duplicate comparison: compact source headers and consistent action controls. */
#duplicate-review-dialog { width: min(1120px, calc(100vw - 40px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); color: var(--text); overflow: auto; }
#duplicate-review-dialog::backdrop { background: rgba(20,25,45,.35); backdrop-filter: blur(3px); }
.dr-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 24px 16px; }
.dr-header h2 { font-size: 19px; margin: 0; font-weight: 650; }
.dr-header p { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
#duplicate-review-dialog [data-close] { width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-elevated); color: var(--text-secondary); font-size: 16px; cursor: pointer; flex-shrink: 0; }
#duplicate-review-dialog [data-content] { padding: 0 24px 22px; font-size: 12px; line-height: 1.5; }
.dr-notice { border-left: 3px solid #e8b657; background: rgba(245,158,11,.07); border-radius: 5px; padding: 9px 12px; color: var(--text-secondary); margin-bottom: 14px; font-size: 11px; }
.dr-notice strong { display: block; color: var(--text); font-size: 12px; margin-bottom: 2px; }
.dr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dr-toolbar > span { color: var(--text-secondary); font-size: 10px; }
.dr-field-switch { display: flex; padding: 3px; gap: 3px; background: var(--bg-elevated); border-radius: 7px; }
.dr-field-switch button { font: inherit; font-size: 11px; padding: 5px 10px; border: none; background: none; border-radius: 5px; color: var(--text-secondary); cursor: pointer; }
.dr-field-switch button[aria-pressed="true"] { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.dr-comparison { overflow: auto; max-height: 42vh; border: 1px solid var(--border); border-radius: 8px; }
#duplicate-review-dialog .dr-comparison table { table-layout: fixed; width: 100%; }
#duplicate-review-dialog .dr-comparison th, #duplicate-review-dialog .dr-comparison td { padding: 9px 12px; font-size: 11px; line-height: 1.5; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; text-transform: none; letter-spacing: 0; }
#duplicate-review-dialog .dr-comparison thead th { background: var(--bg-elevated); font-size: 12px; color: var(--text); }
#duplicate-review-dialog .dr-comparison thead small { display: block; font-size: 10px; font-weight: 400; margin-top: 3px; color: var(--text-secondary); }
#duplicate-review-dialog .dr-comparison tbody th { width: 125px; color: var(--text-secondary); font-size: 10px; font-weight: 600; position: static; }
.dr-different > td { background: rgba(245,158,11,.055); }
.dr-conflict { color: #b45309; font-size: 10px; }
#duplicate-review-dialog details > summary { cursor: pointer; font-size: 11px; font-weight: 550; }
#duplicate-review-dialog details p { font-size: 11px; color: var(--text-secondary); margin: 7px 0; }
#duplicate-review-dialog [data-review-form] { padding: 14px 16px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 9px; }
#duplicate-review-dialog label { font-size: 11px; font-weight: 600; margin-bottom: 5px; }
#duplicate-review-dialog select, #duplicate-review-dialog textarea { font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; width: 100%; background: var(--bg-card); color: var(--text); }
#duplicate-review-dialog textarea { resize: vertical; min-height: 60px; }
#duplicate-review-dialog button[type="submit"], #duplicate-review-dialog [data-reload], #duplicate-review-dialog [data-undo] { font: inherit; font-size: 11px; font-weight: 600; padding: 8px 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text); cursor: pointer; }
#duplicate-review-dialog button[type="submit"] { background: var(--accent); border-color: var(--accent); color: white; }
#duplicate-review-dialog button:disabled { opacity: .5; cursor: wait; }
#duplicate-review-dialog [data-result]:empty { display: none; }
#duplicate-review-dialog [data-result] { font-size: 11px; margin-top: 10px; }
#duplicate-review-dialog button:focus-visible, #duplicate-review-dialog summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 650px) {
  #duplicate-review-dialog { width: calc(100vw - 20px); }
  .dr-header { padding: 18px 16px 14px; }.dr-header h2 { font-size: 17px; }
  #duplicate-review-dialog [data-content] { padding: 0 16px 18px; }
  .dr-toolbar { flex-wrap: wrap; }
}
