/* Mirando branding for the self-hosted InstantDB dashboard.
 *
 * Injected into every dashboard page by nginx (see ../../nginx/dashboard.conf).
 * Everything here is additive and scoped to .mirando-brand -- we never restyle
 * upstream's own elements, so an upstream redesign cannot break the dashboard,
 * only move our badge. */

.mirando-brand {
  /* The header row is a flex container; we are appended last in the DOM (so a
   * React re-render is less likely to drop us) but drawn first. */
  order: -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.75rem;
  margin-right: 0.25rem;
  border-right: 1px solid rgb(212 212 212);
  user-select: none;
  white-space: nowrap;
}

.dark .mirando-brand {
  border-right-color: rgb(64 64 64);
}

/* The glyph is a PNG used as a mask, so it inherits the text colour and needs
 * no separate light/dark asset. */
.mirando-brand__mark {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  background-color: currentColor;
  -webkit-mask: url("/brand/mark.png") center / contain no-repeat;
  mask: url("/brand/mark.png") center / contain no-repeat;
}

.mirando-brand__name {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mirando-brand__tag {
  font-size: 0.6875rem;
  line-height: 1;
  padding: 0.1875rem 0.375rem;
  border-radius: 0.25rem;
  background: rgb(243 244 246);
  color: rgb(107 114 128);
  border: 1px solid rgb(229 231 235);
}

.dark .mirando-brand__tag {
  background: rgb(38 38 38);
  color: rgb(163 163 163);
  border-color: rgb(64 64 64);
}

/* Fallback placement: if the header could not be found (upstream restructured
 * it), the badge pins itself to the bottom-left instead of disappearing. */
.mirando-brand--floating {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  z-index: 2147483000;
  padding: 0.375rem 0.625rem;
  border: 1px solid rgb(212 212 212);
  border-radius: 0.375rem;
  background: rgb(255 255 255);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1);
  margin-right: 0;
}

.dark .mirando-brand--floating {
  background: rgb(38 38 38);
  border-color: rgb(64 64 64);
}

@media (max-width: 640px) {
  .mirando-brand__name,
  .mirando-brand__tag {
    display: none;
  }
}
