.topbar.has-share .top-actions {
  flex-shrink: 0;
}

.share-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.share-button img {
  display: block;
  width: 20px;
  height: 20px;
}

.share-button:focus-visible {
  outline: 2px solid #f3cd94;
  outline-offset: 3px;
}

.share-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #65757f; border-radius: 8px; color: #ecf0f4; background: #122a39; overflow: auto; }
.share-dialog::backdrop { background: #0009; }
.share-dialog [hidden] { display: none !important; }
.share-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #496070; }
.share-dialog-head h2 { margin: 0; font-size: 17px; }
.share-dialog-head .icon-button { width: 32px; min-height: 32px; display: grid; place-items: center; padding: 0; }
.share-dialog-body { padding: 14px 16px 4px; }
.share-modes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 3px; margin: 0 0 14px; padding: 3px; border: 1px solid #526c7c; border-radius: 6px; }
.share-modes label { position: relative; padding: 8px 2px; text-align: center; font-size: 13px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.share-modes label:has(input:checked) { background: #e7c27b; color: #17212b; font-weight: 700; }
.share-modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.share-modes label:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 1px; }
#sharePreview { margin: 0 0 14px; min-height: 100px; }
#sharePreviewImage { display: block; width: 100%; max-height: 290px; object-fit: contain; }
.share-message { margin: 10px 0; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-status { margin: 8px 0; font-size: 12px; color: #f0cf96; line-height: 1.5; }
.share-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; }
.share-dialog-actions .icon-button { display: grid; place-items: center; }
.share-primary, .share-secondary { min-height: 38px; padding: 8px 16px; border: 1px solid #e7c27b; border-radius: 6px; background: #e7c27b; color: #17212b; font: 650 14px/1.4 sans-serif; cursor: pointer; }
.share-secondary { background: transparent; color: #f0cf96; font-size: 12px; }
.share-primary:disabled { opacity: .5; cursor: wait; }
#shareTextInput { box-sizing: border-box; width: 100%; min-height: 92px; resize: vertical; padding: 8px; border: 1px solid #aab7c5; border-radius: 6px; font: 14px/1.6 sans-serif; }
#shareDefaultMode { width: 100%; padding: 8px; font: 14px/1.4 sans-serif; }
#shareConfigResult { font-size: 12px; }
