.rallye-qa-page {
  color: #24313f;
  padding-bottom: 32px;
}

.rallye-qa-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 16px 0;
}

.rallye-qa-header h1 {
  font-size: 1.8rem;
  margin: 0 0 4px;
}

.rallye-qa-header p {
  color: #5f6f80;
  margin: 0;
}

.rallye-qa-breadcrumb {
  color: #687789;
  display: flex;
  flex-wrap: wrap;
  font-size: .82rem;
  gap: 6px;
  margin-bottom: 6px;
}

.rallye-qa-breadcrumb strong {
  color: #24313f;
}

.rallye-qa-selector {
  margin-bottom: 14px;
}

.rallye-qa-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 14px;
}

.rallye-qa-panel,
.rallye-qa-level {
  background: #fff;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  padding: 14px;
}

.rallye-qa-panel h2,
.rallye-qa-level h2 {
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.rallye-qa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.rallye-qa-section-header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.rallye-qa-inline-form {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 10px;
}

.rallye-qa-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 230px;
}

.rallye-qa-stats {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
}

.rallye-qa-stats div {
  background: #f4f7fa;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.rallye-qa-stats strong {
  display: block;
  font-size: 1.35rem;
}

.rallye-qa-stats span {
  color: #607080;
  font-size: .85rem;
}

.rallye-qa-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.rallye-qa-level {
  margin-bottom: 14px;
}

.rallye-qa-edit-missions-panel {
  margin-bottom: 14px;
}

.rallye-qa-missions {
  display: grid;
  gap: 8px;
}

.rallye-qa-mission {
  align-items: center;
  background: #f9fbfd;
  border: 1px solid #e3e9ef;
  border-radius: 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px;
}

.rallye-qa-mission-editor {
  display: block;
}

.rallye-qa-mission-editor-new {
  background: #f7fafc;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  margin: 12px 0;
  padding: 12px;
}

.rallye-qa-mission-editor h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.rallye-qa-mission-editor label {
  color: #4e5f70;
  display: block;
  font-size: .82rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.rallye-qa-mission-editor textarea {
  min-height: 54px;
}

.rallye-qa-mission-editor-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.rallye-qa-empty-state {
  background: #f7fafc;
  border: 1px dashed #c9d5df;
  border-radius: 6px;
  color: #687789;
  padding: 10px;
}

.rallye-qa-activation-summary {
  background: #f7fafc;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  color: #4e5f70;
  padding: 8px;
}

.rallye-qa-activation-summary strong,
.rallye-qa-activation-summary span,
.rallye-qa-activation-summary small {
  display: block;
}

.rallye-qa-checkbox-option {
  align-items: flex-start;
  background: #fff;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  color: #4e5f70;
  display: flex;
  font-size: .86rem;
  gap: 8px;
  padding: 8px;
}

.rallye-qa-checkbox-option input {
  margin-top: 3px;
}

.rallye-qa-mission h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.rallye-qa-mission p {
  color: #617080;
  margin: 0 0 4px;
}

.rallye-qa-mission-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.rallye-qa-mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.rallye-qa-missions-table {
  background: #fff;
  border: 1px solid #e3e9ef;
  margin-bottom: 10px;
}

.rallye-qa-missions-table th {
  background: #f4f7fa;
  color: #4e5f70;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.rallye-qa-missions-table td {
  vertical-align: middle;
}

#rallye-qa-mission-modal label {
  color: #4e5f70;
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 8px;
}

#rallye-qa-mission-modal textarea {
  min-height: 58px;
}

.rallye-qa-steps {
  display: grid;
  gap: 10px;
}

.rallye-qa-kanban {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.rallye-qa-kanban-column {
  background: #f7fafc;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  min-height: 120px;
  padding: 10px;
}

.rallye-qa-kanban-column h3 {
  font-size: .95rem;
  margin: 0 0 8px;
}

.rallye-qa-bug-card {
  background: #fff;
  border: 1px solid #e0e7ef;
  border-radius: 6px;
  margin-bottom: 8px;
  padding: 8px;
}

.rallye-qa-bug-card p {
  color: #4e5f70;
  font-size: .84rem;
  margin: 4px 0;
}

.rallye-qa-bug-card small {
  color: #6b7a89;
}

.rallye-qa-bug-admin {
  border-top: 1px solid #e4ebf2;
  margin-top: 8px;
  padding-top: 8px;
}

.rallye-qa-bug-admin label {
  color: #5f6f80;
  display: block;
  font-size: .78rem;
  font-weight: 600;
  margin: 6px 0 3px;
}

.rallye-qa-dropzone {
  border: 1px dashed #9fb2c5;
  border-radius: 6px;
  padding: 12px;
}

.rallye-qa-bug-preview {
  border: 1px solid #dce5ee;
  border-radius: 6px;
  display: block;
  margin-top: 8px;
  max-height: 180px;
  max-width: 100%;
}

.rallye-qa-capture-modal-body {
  background: #f4f7fa;
  text-align: center;
}

.rallye-qa-capture-image {
  background: #fff;
  border: 1px solid #cfd9e3;
  max-height: 72vh;
  max-width: 100%;
  object-fit: contain;
}

.rallye-qa-step {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.rallye-qa-step input {
  margin-top: 4px;
}

.rallye-qa-step em {
  color: #5e6f81;
  display: block;
  font-style: normal;
  margin-top: 4px;
}

.rallye-qa-companion {
  bottom: 18px;
  color: #24313f;
  position: fixed;
  right: 18px;
  z-index: 1048;
}

.rallye-qa-companion-toggle {
  align-items: center;
  background: #fff;
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(20, 35, 50, .24);
  color: #24313f;
  cursor: grab;
  display: block;
  min-height: 70px;
  padding: 7px 8px;
  text-align: left;
  transition: box-shadow 160ms ease, transform 160ms ease;
  width: 208px;
}

.rallye-qa-companion-toggle:hover,
.rallye-qa-companion-toggle:focus {
  box-shadow: 0 10px 26px rgba(20, 35, 50, .30);
  transform: translateY(-1px);
}

.rallye-qa-companion-mascot {
  font-size: 1.45rem;
  line-height: 1;
}

.rallye-qa-companion-main {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
}

.rallye-qa-companion-summary {
  min-width: 0;
}

.rallye-qa-companion-summary strong,
.rallye-qa-companion-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rallye-qa-companion-summary strong {
  font-size: .84rem;
  line-height: 1.1;
}

.rallye-qa-companion-summary small {
  color: #5f6f80;
  display: -webkit-box;
  font-size: .75rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.15;
  max-height: 1.8rem;
  white-space: normal;
}

.rallye-qa-companion-count {
  color: #5f6f80;
  display: none;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1;
}

.rallye-qa-companion-controls {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 5px;
}

.rallye-qa-companion-icon {
  align-items: center;
  background: #f4f7fa;
  border: 1px solid #d8e1ea;
  border-radius: 6px;
  color: #24313f;
  display: inline-flex;
  font-size: .82rem;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 100%;
}

.rallye-qa-companion-icon:hover,
.rallye-qa-companion-icon:focus {
  background: #e8eff6;
}

.rallye-qa-companion-bug-icon {
  background: #fff2f2;
  border-color: #efb2b2;
  color: #b42318;
}

.rallye-qa-companion-bug-icon:hover,
.rallye-qa-companion-bug-icon:focus {
  background: #ffe2e2;
}

.rallye-qa-companion-skip-icon {
  background: #fff2f2;
  border-color: #efb2b2;
  color: #b42318;
  font-weight: 700;
}

.rallye-qa-companion-skip-icon:hover,
.rallye-qa-companion-skip-icon:focus {
  background: #ffe2e2;
}

.rallye-qa-companion-panel {
  background: #fff;
  border: 1px solid #cfd9e3;
  border-radius: 8px;
  bottom: 76px;
  box-shadow: 0 14px 34px rgba(20, 35, 50, .28);
  max-height: min(680px, calc(100vh - 110px));
  overflow: hidden;
  position: absolute;
  right: 0;
  width: 400px;
}

.rallye-qa-companion-panel-header {
  align-items: center;
  background: #f5f8fb;
  border-bottom: 1px solid #dbe4ec;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
}

.rallye-qa-companion-panel-header small {
  color: #667789;
  display: block;
}

.rallye-qa-companion-body {
  max-height: calc(100vh - 176px);
  overflow-y: auto;
  padding: 12px;
}

.rallye-qa-companion-toolbar {
  margin-bottom: 10px;
}

.rallye-qa-companion-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 10px;
}

.rallye-qa-companion-stats span {
  background: #f3f7fa;
  border-radius: 6px;
  font-weight: 600;
  padding: 7px;
  text-align: center;
}

.rallye-qa-companion-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rallye-qa-companion-badges span {
  background: #edf6f2;
  border: 1px solid #cfe4da;
  border-radius: 999px;
  color: #1f604c;
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 8px;
}

.rallye-qa-companion-section {
  border-top: 1px solid #e2e9f0;
  padding: 10px 0;
}

.rallye-qa-companion-section h3 {
  font-size: 1rem;
  margin: 0 0 6px;
}

.rallye-qa-companion-step {
  align-items: flex-start;
  border: 1px solid #dce5ee;
  border-radius: 6px;
  display: flex;
  gap: 9px;
  margin-bottom: 8px;
  padding: 9px;
}

.rallye-qa-companion-step input {
  margin-top: 3px;
}

.rallye-qa-companion-step strong,
.rallye-qa-companion-step em {
  display: block;
}

.rallye-qa-companion-step em {
  color: #657586;
  font-style: normal;
  margin-top: 3px;
}

.rallye-qa-companion-list-item {
  background: #f8fafc;
  border: 1px solid #e1e8ef;
  border-radius: 6px;
  color: #24313f;
  display: block;
  margin-bottom: 6px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.rallye-qa-companion-list-item small {
  color: #667789;
  display: block;
  margin-top: 2px;
}

.rallye-qa-companion-list-item-active {
  border-color: #23705a;
  box-shadow: inset 3px 0 0 #23705a;
}

.rallye-qa-companion-minimized .rallye-qa-companion-toggle {
  border-radius: 8px;
  min-height: 54px;
  width: 64px;
}

.rallye-qa-companion-minimized .rallye-qa-companion-summary,
.rallye-qa-companion-minimized .rallye-qa-companion-controls,
.rallye-qa-companion-minimized .rallye-qa-companion-panel {
  display: none;
}

.rallye-qa-companion-minimized .rallye-qa-companion-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.rallye-qa-companion-minimized .rallye-qa-companion-count {
  display: block;
}

.rallye-qa-companion-points {
  background: #23705a;
  border-radius: 999px;
  bottom: 68px;
  color: #fff;
  font-weight: 700;
  opacity: 0;
  padding: 8px 12px;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.rallye-qa-companion-points-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .rallye-qa-header,
  .rallye-qa-mission {
    align-items: stretch;
    flex-direction: column;
  }

  .rallye-qa-stats {
    grid-template-columns: 1fr;
  }

  .rallye-qa-companion {
    bottom: 12px;
    right: 12px;
  }

  .rallye-qa-companion-panel {
    bottom: 68px;
    max-height: calc(100vh - 92px);
    width: min(400px, calc(100vw - 24px));
  }

  .rallye-qa-companion-toggle {
    max-width: calc(100vw - 24px);
    width: 208px;
  }
}
