/* BVA AI Summary (2026-11-10): shared by the case preview on /dc/bva-search and
   the full case page. Sizes follow the approved mockup
   (CODEX_CLAUDE_SHARE/BVA-SUMMARY-MOCKUP-2026-11-10/placement.css). Colours are
   the site's own tokens, which flip with the theme, so no dark block is needed
   except for the outcome chips' tinted backgrounds. */

/* The two buttons in the existing action rows. */
.bvas-modal-actions > .bvsum-toggle, .bvd-actions > .bvsum-toggle {
  border: 2px solid var(--color-accent); color: var(--color-primary); font-weight: 700;
  background: var(--color-surface); min-height: 40px; padding: .4rem .9rem;
}
.bvas-modal-actions > .bvsum-toggle[aria-pressed="true"], .bvd-actions > .bvsum-toggle[aria-pressed="true"] { background: var(--color-bg); }
.bvas-modal-actions > .bvsum-toggle[aria-busy="true"], .bvd-actions > .bvsum-toggle[aria-busy="true"] { cursor: progress; }
.bvas-modal-actions > .bvsum-download, .bvd-actions > .bvsum-download { min-height: 40px; }
.bvsum-toggle[hidden], .bvsum-download[hidden] { display: none; }
.bvsum-toggle:focus-visible, .bvsum-download:focus-visible, .bvsum-panel button:focus-visible, .bvsum-return button:focus-visible {
  outline: 2px solid var(--color-primary); outline-offset: 2px;
}

/* The summary takes the place of the decision text in the same reading area. */
.bvsum-panel { font-family: Inter, Arial, sans-serif; color: var(--color-text); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.bvsum-panel[hidden] { display: none; }
.bvas-modal-card .bvsum-panel { max-height: 60vh; overflow-y: auto; }
.bvsum-top { padding: 20px 22px; border-bottom: 1px solid var(--color-border); }
.bvsum-body { padding: 20px 22px; }
.bvsum-eyebrow { font-size: 12px; letter-spacing: .12em; font-weight: 700; color: var(--color-text-muted); margin: 0 0 .5rem; }
.bvsum-panel .bvsum-h { font-size: 24px; line-height: 1.25; margin: 0 0 .6rem; color: var(--color-primary); }
.bvsum-panel .bvsum-h:focus { outline: none; }
.bvsum-lead { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; line-height: 1.55; margin: 0 0 .6rem; }
.bvsum-panel .bvsum-section { font-family: Inter, Arial, sans-serif; font-size: 15px; font-weight: 600; margin: 0 0 .75rem; color: var(--color-text); }
.bvsum-issues { border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 1.1rem; }
.bvsum-issue { display: grid; grid-template-columns: 128px 1fr; gap: 14px; padding: 15px; }
.bvsum-issue + .bvsum-issue { border-top: 1px solid var(--color-border); }
.bvsum-panel h4 { font-family: Inter, Arial, sans-serif; font-size: 15px; font-weight: 600; margin: 0 0 .3rem; color: var(--color-text); }
.bvsum-issue p, .bvsum-reason p, .bvsum-next p, .bvsum-service p, .bvsum-more-body p { font-size: 14px; line-height: 1.6; margin: 0 0 .35rem; color: var(--color-text); }
.bvsum-outcome { display: inline-flex; align-items: center; gap: .35rem; align-self: start; justify-self: start; font-size: 12px; font-weight: 700; padding: .25rem .55rem; border-radius: var(--radius-sm); border: 1px solid currentColor; background: var(--color-surface); color: var(--color-text-muted); white-space: nowrap; }
.bvsum-outcome-granted, .bvsum-outcome-partly-granted { color: var(--color-success); }
.bvsum-outcome-denied { color: var(--color-danger); }
.bvsum-outcome-remanded { color: var(--color-warning); }
.bvsum-outcome-reopened { color: var(--color-primary); }
.bvsum-service { border-left: 3px solid var(--color-primary); background: var(--color-bg); padding: 13px 15px; margin-bottom: 1.1rem; font-size: 14px; }
.bvsum-service b { display: block; margin-bottom: .25rem; }
.bvsum-reasons { margin-bottom: 1.1rem; }
.bvsum-reason { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: .5rem 0; }
.bvsum-reason-n { font-weight: 700; color: var(--color-text-muted); font-size: 14px; }
.bvsum-next { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 15px; margin-bottom: 1.1rem; }
.bvsum-panel .bvsum-next h3 { font-family: Inter, Arial, sans-serif; font-size: 15px; font-weight: 600; margin: 0 0 .4rem; color: var(--color-text); }
.bvsum-more { border-top: 1px solid var(--color-border); }
.bvsum-more summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: .8rem 0; min-height: 44px; display: flex; align-items: center; }
.bvsum-more-body { padding: 0 0 .8rem; }
.bvsum-disclosure { font-size: 12px; line-height: 1.55; color: var(--color-text-muted); margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--color-border); }

.bvsum-source-link, .bvsum-read, .bvsum-back, .bvsum-retry, .bvsum-return button {
  font: inherit; font-size: 13px; cursor: pointer; background: transparent; border: 0; padding: 0 .1rem; min-height: 40px;
  color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px;
}
.bvsum-source-link::before { content: '\1F517\FE0E'; display: inline-block; margin-right: .35rem; text-decoration: none; font-size: 12px; }

/* Source passages */
.bvsum-source { padding: 20px 22px; }
.bvsum-source-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.bvsum-explainer { font-size: 13px; color: var(--color-text-muted); margin: 0 0 1rem; line-height: 1.55; }
.bvsum-excerpt { border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: .9rem; background: var(--color-bg); }
.bvsum-passage-label { font-size: 12px; letter-spacing: .08em; font-weight: 700; color: var(--color-text-muted); margin-bottom: .4rem; }
.bvsum-excerpt blockquote { font-family: 'Source Serif 4', Georgia, serif; font-size: 16px; line-height: 1.6; margin: 0 0 .3rem; padding: 0; border: 0; white-space: pre-wrap; color: var(--color-text); }

/* "Read in decision": the passage inside the original text, and the way back. */
.bvsum-hl { display: block; border-left: 3px solid var(--color-accent); padding: 8px; background: var(--color-surface); scroll-margin-top: 75px; }
.bvsum-hl:focus { outline: none; }
/* On the full case page the whole page scrolls, so the way back rides along
   under the site header; in the preview it already sits above the scrolling text. */
.bvd-shell .bvsum-return { position: sticky; top: 72px; z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.bvd-shell .bvsum-hl { scroll-margin-top: 140px; }
.bvsum-return { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; font-size: 13px; padding: 4px 12px; margin-bottom: .4rem; border: 1px solid var(--color-border); border-left: 3px solid var(--color-accent); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text); }

.bvsum-note { font-size: 13px; color: var(--color-text); align-self: center; flex-basis: 100%; }
.bvsum-note:empty { display: none; }
.bvsum-status { padding: 24px 22px; font-size: 15px; line-height: 1.6; }
.bvsum-status p { margin: 0 0 .5rem; }

@media (max-width: 640px) {
  .bvas-modal-actions > .bvsum-toggle, .bvd-actions > .bvsum-toggle,
  .bvas-modal-actions > .bvsum-download, .bvd-actions > .bvsum-download { min-height: 44px; }
  .bvsum-top, .bvsum-body, .bvsum-source { padding: 17px; }
  .bvsum-panel .bvsum-h { font-size: 23px; }
  .bvsum-lead { font-size: 17px; }
  .bvsum-issue { grid-template-columns: 1fr; gap: 7px; padding: 13px; }
  .bvsum-reason { grid-template-columns: 21px 1fr; }
  .bvsum-source-link, .bvsum-read, .bvsum-back, .bvsum-retry, .bvsum-return button { min-height: 44px; }
  .bvas-modal-card .bvsum-panel { max-height: 58dvh; }
}
