.reportly-command-trigger {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 32px;
  padding: .28rem .48rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: .42rem;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.82);
  font-size: .68rem;
}
.reportly-command-trigger:hover { border-color: var(--color-accent); color: #fff; }
.reportly-command-trigger kbd { padding: .12rem .28rem; border: 1px solid rgba(255,255,255,.15); border-radius: .24rem; background: rgba(0,0,0,.15); color: rgba(255,255,255,.62); font-family: inherit; font-size: .56rem; }
.reportly-command-trigger-compact { flex: 0 0 auto; justify-content: center; width: 36px; margin-left: auto; padding-inline: 0; }

.reportly-command-backdrop[hidden] { display: none; }
.reportly-command-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: min(14vh, 120px) 1rem 1rem;
  background: rgba(2,6,23,.68);
  backdrop-filter: blur(6px);
  animation: commandBackdropIn .16s ease both;
}
.reportly-command {
  width: min(650px, 100%);
  max-height: min(660px, 76vh);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: .72rem;
  background: var(--color-card);
  box-shadow: 0 28px 80px rgba(0,0,0,.38);
  animation: commandPaletteIn .2s ease both;
}
.reportly-command-header { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .7rem; min-height: 62px; padding: 0 1rem; border-bottom: 1px solid var(--color-border); }
.reportly-command-header > i { color: var(--color-accent); font-size: 1rem; }
.reportly-command-header input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--color-text); font-size: 1rem; }
.reportly-command-header input::placeholder { color: var(--color-text-muted); }
.reportly-command-header button { display: flex; align-items: center; gap: .3rem; min-height: 30px; padding: .2rem .4rem; border: 1px solid var(--color-border); border-radius: .34rem; background: transparent; color: var(--color-text-muted); font-size: .58rem; }
.reportly-command-header button i { display: none; }
.reportly-command-context { display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem .4rem; color: var(--color-text-muted); }
.reportly-command-context span { font-size: .62rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.reportly-command-context small { font-size: .6rem; }
.reportly-command-results { max-height: min(500px, calc(76vh - 140px)); padding: 0 .55rem .55rem; overflow-y: auto; scrollbar-width: thin; }
.reportly-command-results::-webkit-scrollbar { width: 6px; }
.reportly-command-results::-webkit-scrollbar-track { background: transparent; }
.reportly-command-results::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb, var(--color-text-muted) 45%, transparent); }
.reportly-command-result { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: .7rem; width: 100%; min-height: 58px; padding: .5rem .6rem; border: 0; border-radius: .45rem; background: transparent; color: var(--color-text); text-align: left; }
.reportly-command-result:hover,
.reportly-command-result.is-active { background: color-mix(in srgb, var(--color-accent) 8%, var(--color-surface)); }
.reportly-command-result:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }
.reportly-command-result-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--color-border); border-radius: .38rem; background: var(--color-surface); color: var(--color-text-muted); }
.reportly-command-result.is-active .reportly-command-result-icon { border-color: color-mix(in srgb, var(--color-accent) 50%, var(--color-border)); color: var(--color-accent); }
.reportly-command-result-copy { min-width: 0; }
.reportly-command-result-copy strong,
.reportly-command-result-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reportly-command-result-copy strong { font-size: .76rem; }
.reportly-command-result-copy span { margin-top: .14rem; color: var(--color-text-muted); font-size: .62rem; }
.reportly-command-result-meta { color: var(--color-text-muted); font-size: .58rem; }
.reportly-command-empty { padding: 3.5rem 1rem; color: var(--color-text-muted); text-align: center; }
.reportly-command-empty i { display: block; margin-bottom: .55rem; font-size: 1.35rem; }
.reportly-command-empty strong { display: block; color: var(--color-text); font-size: .78rem; }
.reportly-command-empty span { display: block; margin-top: .25rem; font-size: .65rem; }
.reportly-command-footer { display: flex; gap: 1rem; min-height: 38px; padding: .55rem 1rem; border-top: 1px solid var(--color-border); color: var(--color-text-muted); font-size: .57rem; }
.reportly-command-footer span:last-child { margin-left: auto; }
.reportly-command-footer kbd { margin-right: .15rem; padding: .05rem .25rem; border: 1px solid var(--color-border); border-radius: .2rem; background: var(--color-surface); color: inherit; font-family: inherit; }
body.reportly-command-open { overflow: hidden; }

@keyframes commandBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes commandPaletteIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 680px) {
  .reportly-command-trigger span,
  .reportly-command-trigger kbd { display: none; }
  .reportly-command-backdrop { align-items: stretch; padding: 0; }
  .reportly-command { width: 100%; max-height: 100svh; border: 0; border-radius: 0; }
  .reportly-command-header { min-height: 66px; }
  .reportly-command-header button span { display: none; }
  .reportly-command-header button i { display: block; }
  .reportly-command-results { max-height: calc(100svh - 142px); }
  .reportly-command-footer span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reportly-command-backdrop,
  .reportly-command { animation: none; }
}
