/* Shadcn Base UI Button / ButtonGroup presentation, adapted to native markup.
   Shared by the gallery, viewer, administration and password screen.
   Reference: https://ui.shadcn.com/docs/components/base/button-group */
[data-slot="button"] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  flex-shrink: 0; min-height: var(--control); padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--secondary);
  font: 500 12px/1.4 var(--font); white-space: nowrap; text-decoration: none;
  vertical-align: middle; cursor: pointer; outline: none;
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
[data-slot="button"]:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--hover); border-color: #55515f; color: var(--text); text-decoration: none;
}
[data-slot="button"]:active:not(:disabled) { background: var(--raised); }
[data-slot="button"]:focus-visible {
  position: relative; z-index: 2; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
  outline: 2px solid transparent;
}
[data-slot="button"]:disabled, [data-slot="button"][aria-disabled="true"] {
  opacity: .45; pointer-events: none;
}
[data-slot="button"] svg { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
[data-slot="button"][data-variant="default"] {
  color: #fff; background: var(--accent-solid); border-color: #8258f2;
}
[data-slot="button"][data-variant="default"]:hover:not(:disabled) {
  color: #fff; background: var(--accent-hover); border-color: #9b7bf8;
}
[data-slot="button"][data-variant="default"]:active:not(:disabled) { background: #5a2bd6; }
[data-slot="button"][data-variant="accent"] {
  color: var(--accent); background: var(--accent-surface); border-color: #4a3b61;
}
[data-slot="button"][data-variant="accent"]:hover:not(:disabled) {
  color: #d5ceff; background: #2a2141; border-color: #665582;
}
[data-slot="button"][data-variant="ghost"] { color: var(--muted); background: transparent; border-color: transparent; }
[data-slot="button"][data-variant="ghost"]:hover:not(:disabled) { color: var(--text); background: var(--raised); border-color: transparent; }
[data-slot="button"][data-size="sm"], [data-slot="button"][data-size="icon-sm"] { min-height: 32px; padding: 6px 10px; font-size: 11px; }
[data-slot="button"][data-size="lg"], [data-slot="button"][data-size="icon-lg"] { min-height: 48px; padding: 12px 16px; font-size: 13px; }
[data-slot="button"][data-size^="icon"] { width: var(--control); padding: 8px; }
[data-slot="button"][data-size="icon-sm"] { width: 32px; }
[data-slot="button"][data-size="icon-lg"] { width: 48px; }

/* One border between controls; rounded corners only on the outer edges.
   Nested groups remain separate, following the reference's nested-group pattern. */
[data-slot="button-group"] { display: flex; align-items: stretch; width: fit-content; min-width: 0; gap: 0; isolation: isolate; }
[data-slot="button-group"]:has(> [data-slot="button-group"]) { gap: 8px; flex-wrap: wrap; }
[data-slot="button-group"]:not(:has(> [data-slot="button-group"])) > :not([hidden]) { border-radius: 0; }
[data-slot="button-group"]:not(:has(> [data-slot="button-group"])) > :nth-child(1 of :not([hidden])) { border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
[data-slot="button-group"]:not(:has(> [data-slot="button-group"])) > :nth-last-child(1 of :not([hidden])) { border-top-right-radius: var(--radius); border-bottom-right-radius: var(--radius); }
[data-slot="button-group"]:not(:has(> [data-slot="button-group"])) > :not([hidden]) ~ :not([hidden]) { margin-left: -1px; }
[data-slot="button-group"] > :focus-visible, [data-slot="button-group-item"]:focus-within { position: relative; z-index: 2; }
[data-slot="button-group-item"] { display: flex; }
[data-slot="button-group-item"] > [data-slot="button"] { border-radius: inherit; height: 100%; }
[data-slot="button-group"] > input { flex: 1; min-width: 0; }
[data-slot="button-group-text"] { display: inline-flex; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); }
[data-slot="toggle-group"] [aria-pressed="true"] { color: var(--accent); border-color: #55466f; background: var(--accent-surface); }
[data-slot="button-group"][data-orientation="vertical"] { flex-direction: column; }
[data-slot="button-group"][data-orientation="vertical"] > :not([hidden]) { border-radius: 0; margin-left: 0; }
[data-slot="button-group"][data-orientation="vertical"] > :nth-child(1 of :not([hidden])) { border-radius: var(--radius) var(--radius) 0 0; }
[data-slot="button-group"][data-orientation="vertical"] > :nth-last-child(1 of :not([hidden])) { border-radius: 0 0 var(--radius) var(--radius); }
[data-slot="button-group"][data-orientation="vertical"] > :not([hidden]) ~ :not([hidden]) { margin-top: -1px; margin-left: 0; }
@media (max-width: 600px), (pointer: coarse) {
  [data-slot="button"][data-size="sm"], [data-slot="button"][data-size="icon-sm"] { min-height: 40px; }
  [data-slot="button"][data-size="icon-sm"] { width: 40px; }
}
@media (max-width: 600px) {
  .live-nav [data-slot="button"] { padding-inline: 10px; font-size: 11px; }
  .viewer-actions[data-slot="button-group"] { display: contents; }
  .viewer-label { max-width: calc(100% - 144px); }
  .download[data-slot="button"] { width: var(--control); padding: 8px; }
  .conflict-actions[data-slot="button-group"] { max-width: 100%; }
  .conflict-actions [data-slot="button"] { white-space: normal; flex: 1; min-width: 0; }
}
@media (forced-colors: active) {
  [data-slot="button"]:focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}

/* Shared border highlight for investigation entry and detail-page management.
   Animate only the overlay opacity: the 475-card homepage must not repaint a
   changing clip-path every frame or keep hundreds of forced GPU layers alive. */
[data-slot="button"].btn.fx-15 {
  --primary: var(--accent);
  --secondary: var(--bg);
  --surface: var(--accent-surface);
  --bink: var(--primary);
  --bsurf: var(--surface);
  --radius: 8px;
  position: relative; isolation: isolate;
  font-family: "JetBrains Mono", var(--mono);
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  min-height: 46px; max-width: 100%; padding: 13px 24px;
  border: 1px solid transparent; border-radius: var(--radius);
  color: var(--bink); background: transparent; overflow: visible; white-space: nowrap;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bink) 25%, transparent);
  transition: none;
}
.btn.fx-15 .btn-label { position: relative; z-index: 2; display: inline-block; }
/* Actions use the brand accent; green/yellow/red describe the current status only. */
.handout-actions[data-slot="button-group"] { max-width: 100%; gap: 10px; }
.handout-actions > [data-slot="button-group"] { max-width: 100%; gap: 10px; flex-wrap: wrap; }
.handout-actions [data-slot="button-group"] > [data-slot="button"].btn.fx-15 { margin: 0; border-radius: 8px; }
.discord-launch-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.discord-launch-note a { display: inline-block; padding-block: 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.discord-launch-note a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn.fx-15::before { display: none; }
.btn.fx-15::after {
  content: ""; position: absolute; z-index: 1; inset: 0; border-radius: inherit;
  border: 2px solid var(--bink); opacity: 0;
  pointer-events: none; transition: opacity 180ms ease-out;
}
[data-slot="button"].btn.fx-15:is(:hover, :focus-visible, :active):not(:disabled):not([aria-disabled="true"]) {
  color: var(--bink); background: transparent; border-color: transparent;
}
.btn.fx-15:is(:hover, :focus-visible, :active):not(:disabled):not([aria-disabled="true"])::after { opacity: 1; }
[data-slot="button"].btn.fx-15:focus-visible {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bink) 25%, transparent), 0 0 0 3px color-mix(in srgb, var(--bink) 25%, transparent);
}
/* Keep the long Discord label readable in the narrower photo inspector and phones. */
.inspector [data-slot="button"].btn.fx-15 { font-size: 11px; padding-inline: 16px; }
@media (max-width: 600px) {
  [data-slot="button"].btn.fx-15 { font-size: 11px; padding-inline: 18px; }
}
@media (forced-colors: active) {
  [data-slot="button"].btn.fx-15 { border-color: ButtonText; }
  [data-slot="button"].btn.fx-15:focus-visible { outline: 2px solid Highlight; outline-offset: 3px; }
}
