/* The system-administrator "View As..." toolbar (see
   layouts/_view_as_toolbar.html.erb) — deliberately styled to read as a
   dev/QA tool bolted onto the page, not as site chrome, so it's never
   mistaken for something an ordinary visitor would see. */
.view-as-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.5rem;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.view-as-toolbar__summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
}

.view-as-toolbar__summary strong {
  white-space: nowrap;
}

.view-as-toolbar__permissions {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #94a3b8;
}

.view-as-toolbar__links {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  flex: 0 0 auto;
}

.view-as-toolbar__links a {
  color: #e2e8f0;
  text-decoration: none;
  white-space: nowrap;
}

.view-as-toolbar__links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.view-as-toolbar__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.view-as-toolbar__label {
  white-space: nowrap;
  color: #94a3b8;
}

.view-as-toolbar__form select {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

/* The admin dashboard link, far left (see admin/dashboards/show). */
.view-as-toolbar__home {
  flex: 0 0 auto;
  padding: 0.2rem 0.65rem;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.view-as-toolbar__home:hover {
  background: #1e293b;
  color: #ffffff;
}

.view-as-toolbar__chooser {
  position: relative;
  flex: 0 0 auto;
}

.view-as-toolbar__change,
.view-as-picker__close {
  background: transparent;
  color: #94a3b8;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.view-as-toolbar__change:hover,
.view-as-picker__close:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* "A Specific User…": a search dropping down under the select. */
.view-as-picker {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: min(24rem, calc(100vw - 2rem));
  padding: 0.6rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
}

.view-as-picker[hidden] {
  display: none;
}

.view-as-picker__head {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.view-as-picker__head input {
  flex: 1;
  min-width: 0;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.view-as-picker__close {
  font-size: 1.2rem;
  line-height: 1;
}

.view-as-picker__hint {
  margin: 0.6rem 0.2rem 0.2rem;
  color: #94a3b8;
}

.view-as-picker__results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  max-height: 20rem;
  overflow-y: auto;
}

.view-as-picker__results form {
  margin: 0;
}

.view-as-picker__result {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: transparent;
  color: #e2e8f0;
  border: 0;
  border-radius: 6px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.view-as-picker__result:hover,
.view-as-picker__result:focus-visible {
  background: #1e293b;
}

.view-as-picker__name {
  display: block;
  font-weight: 600;
}

.view-as-picker__meta {
  display: block;
  color: #94a3b8;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
