.ba-dialog { width: min(445px,calc(100vw - 28px)); padding: 0; max-height: calc(100dvh - 32px); overflow: auto; margin: auto; border: 1px solid #c9d0c8; border-radius: 8px; color: #202727; background: white; box-shadow: 0 12px 45px #22342928; }
.ba-dialog::backdrop { background: #23312b4c; }
.ba-dialog button, .ba-dialog select, .ba-dialog input { font: inherit; }
.ba-head { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 21px 22px 14px; }
.ba-head h2 { margin: 0; color: #202727; font-size: 21px; letter-spacing: -.04em; font-weight: 580; }
.ba-close { display: grid; place-items: center; width: 28px; height: 28px; background: transparent; color: #57665d; border: 0; border-radius: 4px; }
.ba-close:hover { background: #f1f3ed; }
.ba-body { padding: 0 22px 22px; }
.ba-scope { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 15px; border-bottom: 1px solid #e1e5dd; }
.ba-scope strong, .ba-detail strong { overflow-wrap: anywhere; min-width: 0; font-size: 14px; font-weight: 590; }
.ba-badge { white-space: nowrap; padding: 3px 6px; border-radius: 4px; background: #eaf1eb; color: #345a48; font-size: 11px; }
.ba-field { display: grid; gap: 6px; margin: 15px 0 6px; font-size: 12px; color: #344039; font-weight: 560; }
.ba-field select, .ba-field input { min-width: 0; height: 36px; padding: 0 8px; border-radius: 4px; border: 1px solid #cdd4cc; background: white; color: #26332b; font-size: 13px; font-weight: 420; }
.ba-note, .ba-status { color: #626e66; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.ba-note { margin: 7px 0 0; }
.ba-actions, .ba-link-row { display: flex; align-items: center; gap: 8px; }
.ba-actions { margin-top: 17px; }
.ba-link { padding-top: 15px; border-top: 1px solid #dfe5dd; }
.ba-link-row input { width: 0; flex: 1; }
.ba-dialog .ba-primary, .ba-dialog .ba-quiet, .ba-dialog .ba-secondary { padding: 7px 10px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; font-weight: 580; white-space: nowrap; }
.ba-dialog .ba-primary { background: #176758; color: white; }
.ba-dialog .ba-quiet { background: transparent; color: #865048; }
.ba-dialog .ba-secondary { border-color: #d1d8cd; background: white; color: #344039; }
.ba-dialog .ba-primary:hover { background: #145548; }
.ba-dialog :is(.ba-secondary,.ba-quiet):hover { background: #f2f4ef; }
.ba-status { margin: -8px 22px 16px; }
.ba-status:empty { display: none; }
.ba-status.ba-error { color: #924c42; }
.ba-list { list-style: none; margin: 15px 0 0; padding: 0; }
.ba-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid #dfe4dc; }
.ba-detail { min-width: 0; display: grid; gap: 3px; }
.ba-detail span, .ba-detail time { overflow-wrap: anywhere; color: #647168; font-size: 11px; }
.ba-empty { display: block; margin: 8px 0; font-size: 14px; }
.ba-dialog :focus-visible { outline: 2px solid #176758; outline-offset: 2px; }
.ba-confirm-title { margin: 2px 0 6px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.ba-dialog .ba-danger { padding: 7px 10px; border: 1px solid #8c3d36; border-radius: 4px; background: #8c3d36; color: white; font-size: 12px; font-weight: 580; }
.ba-dialog .ba-danger:hover { background: #76332d; }
.ba-token-details > .ba-note:first-child { margin-top: 0; }
.ba-token-details :is(.ba-field input,.ba-token-reveal input) { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.ba-token-details .ba-scope { margin-top: 15px; border-top: 1px solid #e1e5dd; border-bottom: 0; padding: 13px 0 0; }
.ba-token-confirm:not(:empty), .ba-token-reveal:not(:empty) { margin-top: 15px; }
.ba-token-reveal .ba-field { margin-top: 0; }

html[data-theme="dark"] .ba-dialog {
  background: var(--theme-panel);
  border-color: var(--theme-line);
  color: var(--theme-text);
  box-shadow: 0 10px 32px #0005;
  &::backdrop { background: #050a0eaa; }
  & :is(.ba-head h2, .ba-field) { color: var(--theme-text); }
  & :is(.ba-close, .ba-note, .ba-status, .ba-detail span, .ba-detail time) { color: var(--theme-muted); }
  & :is(.ba-scope, .ba-link, .ba-row) { border-color: var(--theme-line); }
  & .ba-badge { color: var(--theme-accent); background: #283d39; }
  & .ba-field :is(select, input) { color: var(--theme-text); border-color: #829094; background: var(--theme-bg); }
  & .ba-primary { color: #102c25; background: var(--theme-accent); }
  & .ba-primary:hover { background: #a1e7d4; }
  & .ba-secondary { color: var(--theme-text); border-color: var(--theme-line); background: var(--theme-panel); }
  & :is(.ba-quiet,.ba-status.ba-error) { color: #ffada5; }
  & :is(.ba-secondary,.ba-quiet,.ba-close):hover { background: var(--theme-raised); }
  & .ba-danger { background: #f5a399; border-color: #f5a399; color: #371410; }
  & .ba-danger:hover { background: #ffc0b8; }
  & :focus-visible { outline-color: var(--theme-accent); }
}
