:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f7f9;
  color: #182b3a;
  --brand: #2c6175;
  --brand-strong: #1f5165;
  --brand-soft: #eaf2f5;
  --ink: #182b3a;
  --muted: #63798e;
  --line: #d8e2e8;
  --surface: #ffffff;
  --surface-soft: #eef4f6;
}

* {
  box-sizing: border-box;
}

body {
  background: #f4f7f9;
  margin: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  cursor: pointer;
  display: inline-block;
  padding: 0.65rem 0.95rem;
  text-align: center;
}

button:hover,
.button-link:hover {
  background: var(--brand-strong);
  color: white;
  text-decoration: none;
}

button:disabled {
  background: #9aa6b2;
  cursor: not-allowed;
}

button.is-loading {
  min-width: 7.5rem;
}

button.secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: #345064;
}

button.secondary:hover {
  background: #e0ebef;
  color: var(--ink);
}

button.danger {
  background: #b42318;
}

button.danger.secondary {
  background: #fde8e7;
  color: #9f1f17;
}

input {
  background: var(--surface);
  border: 1px solid #bdcdd7;
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  width: 100%;
}

select {
  background: var(--surface);
  border: 1px solid #bdcdd7;
  border-radius: 6px;
  color: var(--ink);
  padding: 0.58rem 0.7rem;
}

textarea {
  background: var(--surface);
  border: 1px solid #bdcdd7;
  border-radius: 6px;
  font: inherit;
  padding: 0.6rem 0.7rem;
  resize: vertical;
  width: 100%;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 88px;
  padding: 0.85rem 2rem;
}

.topbar-tools,
.topbar-tools form {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 0.85rem;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: 9px;
  color: white;
  display: inline-flex;
  font-size: 1.25rem;
  font-weight: 700;
  height: 3.1rem;
  justify-content: center;
  width: 3.1rem;
}

.brand-identity {
  align-items: baseline;
  display: inline-flex;
  gap: 0.45rem;
}

.brand-name {
  font-size: 1.55rem;
  font-weight: 700;
}

.brand-product,
.workspace-status,
.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-product {
  color: #688095;
  font-size: 0.94rem;
  font-weight: 400;
}

.workspace-status {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.status-dot {
  background: #2d8a57;
  border-radius: 999px;
  height: 0.6rem;
  width: 0.6rem;
}

.user,
.muted {
  color: var(--muted);
}

.compact-button {
  padding: 0.45rem 0.7rem;
}

.shell {
  margin: 0 auto;
  max-width: 1500px;
  padding: 2rem;
}

.page-heading {
  margin-bottom: 1.35rem;
}

.heading-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.page-heading h1,
.panel h1,
.panel h2,
.empty h2 {
  color: var(--ink);
  margin: 0 0 0.8rem;
}

.workspace-intro {
  max-width: 880px;
  padding: 2rem 0 2.4rem;
}

.workspace-intro .eyebrow,
.page-heading .eyebrow,
.results-header .eyebrow,
.panel > .eyebrow,
.section-heading .eyebrow {
  color: var(--brand);
  margin: 0 0 0.65rem;
}

.workspace-intro h1 {
  color: var(--ink);
  font-size: 2.5rem;
  line-height: 1.08;
  margin: 0;
}

.workspace-intro > p:last-child,
.panel-intro {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0.75rem 0 0;
}

.section-heading {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.panel,
.empty,
.row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1.25rem;
}

.provider-banner {
  align-items: center;
  border-radius: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
}

.provider-banner.mock {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.provider-banner.qagenie {
  background: #edf7f2;
  border: 1px solid #c5e3d4;
  color: #246746;
}

.narrow {
  margin: 3rem auto;
  max-width: 420px;
}

.login-panel h1 {
  font-size: 1.8rem;
  line-height: 1.2;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.inline-form {
  align-items: end;
  display: flex;
  gap: 1rem;
}

.grow {
  flex: 1;
}

.list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.spaced {
  margin-top: 1rem;
}

.row-card,
.project-link {
  align-items: center;
  color: inherit;
  display: flex;
  justify-content: space-between;
}

.project-link {
  flex: 1;
  gap: 1rem;
}

.list-heading {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 700;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0 1rem;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 1rem;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 7px;
  padding: 0.75rem;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

.flash.success {
  background: #dcfce7;
  color: #166534;
}

.stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.stats div {
  background: var(--surface-soft);
  border: 1px solid #e0e9ed;
  border-radius: 6px;
  padding: 0.8rem;
}

.stats dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.stats dd {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.2rem 0 0;
}

.table {
  display: grid;
  gap: 0.5rem;
}

.table-row {
  align-items: center;
  border-bottom: 1px solid #e2eaee;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 2fr 0.8fr 0.6fr 2fr 1fr;
  padding: 0.7rem 0;
}

.table-head {
  background: var(--surface-soft);
  border: 1px solid #d7e3e8;
  color: #567084;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.7rem;
}

.table small {
  color: var(--muted);
  display: block;
  margin-top: 0.2rem;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
}

.badge.extracted {
  background: #e4f5ea;
  color: #256747;
}

.badge.failed {
  background: #fee2e2;
  color: #991b1b;
}

.badge.pending,
.badge.running,
.badge.retrying {
  background: #fef3c7;
  color: #92400e;
}

.badge.canceled {
  background: #e8edf2;
  color: #263442;
}

.badge.succeeded,
.badge.draft {
  background: #e1f0f5;
  color: #275e74;
}

.badge.needsclarification {
  background: #fef3c7;
  color: #92400e;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.run-row {
  grid-template-columns: 0.8fr 0.8fr 0.8fr 0.6fr 2fr;
}

.case-list {
  display: grid;
  gap: 0.85rem;
}

.case-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 1rem;
}

.case-card p {
  margin: 0.7rem 0 0;
}

.case-card ol {
  margin: 0.7rem 0 0;
  padding-left: 1.4rem;
}

.case-header {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.results-header {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.results-header h1 {
  margin: 0.35rem 0 0.45rem;
  max-width: 820px;
  overflow-wrap: anywhere;
}

.results-meta,
.results-actions,
.export-bar,
.review-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-meta {
  color: var(--muted);
}

.results-actions {
  justify-content: flex-end;
}

.status-pill,
.type-badge,
.priority-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

.status-pill.ok,
.status-pill.succeeded {
  background: #dcfce7;
  color: #166534;
}

.status-pill.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.needsclarification,
.status-pill.pending,
.status-pill.running {
  background: #fef3c7;
  color: #92400e;
}

.export-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 0.85rem;
  padding: 0.8rem;
}

.review-toolbar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 0.75rem;
  padding: 0.8rem;
}

.export-bar label,
.review-toolbar label {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  gap: 0.5rem;
}

.review-toolbar .search-control {
  flex: 1 1 280px;
}

.review-toolbar input[type="search"] {
  min-width: 220px;
}

.select-all-control input {
  height: 1rem;
  padding: 0;
  width: 1rem;
}

.results-list {
  display: grid;
  gap: 0.65rem;
}

.testcase-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.testcase-row[open] {
  border-color: #a9c4d0;
  box-shadow: 0 8px 20px rgb(31 81 101 / 0.08);
}

.testcase-row summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto 5.25rem minmax(0, 1fr) auto auto auto 1.2rem;
  list-style: none;
  padding: 0.9rem 1rem;
}

.testcase-row summary::-webkit-details-marker {
  display: none;
}

.select-cell {
  align-items: center;
  display: flex;
}

.select-cell input {
  cursor: pointer;
  height: 1rem;
  padding: 0;
  width: 1rem;
}

.case-id {
  color: #36556a;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
}

.case-title {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.chevron::before {
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  content: "";
  display: inline-block;
  height: 0.45rem;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
  width: 0.45rem;
}

.testcase-row[open] .chevron::before {
  transform: rotate(-135deg);
}

.type-badge.functional {
  background: #e1f0f5;
  color: #275e74;
}

.type-badge.negative {
  background: #fee2e2;
  color: #991b1b;
}

.type-badge.edge {
  background: #f1edf9;
  color: #654696;
}

.type-badge.security {
  background: #ffe4e6;
  color: #9f1239;
}

.type-badge.performance {
  background: #d9f1ed;
  color: #176f67;
}

.type-badge.usability {
  background: #e0f2fe;
  color: #0369a1;
}

.type-badge.other,
.priority-badge.other {
  background: #e7eef2;
  color: #345064;
}

.priority-badge.high {
  background: #fee2e2;
  color: #991b1b;
}

.priority-badge.medium {
  background: #fef3c7;
  color: #92400e;
}

.priority-badge.low {
  background: #dcfce7;
  color: #166534;
}

.review-count {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
}

.case-details {
  border-top: 1px solid #e1e9ed;
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.review-flags {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  color: #9a3412;
  padding: 0.8rem;
}

.review-flags strong {
  display: block;
  margin-bottom: 0.35rem;
}

.review-flags ul {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding-left: 1.2rem;
}

.detail-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-block {
  min-width: 0;
}

.detail-block h2 {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
}

.detail-block p,
.detail-block li,
.coverage-block p,
.alert-block p,
.question-list li {
  overflow-wrap: anywhere;
}

.detail-block p {
  margin: 0;
}

.detail-block ol {
  margin: 0;
  padding-left: 1.35rem;
}

.detail-block.expected {
  background: #f4f8f9;
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 0.8rem;
}

.results-support {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.alert-block,
.coverage-block {
  border-radius: 7px;
  padding: 1rem;
}

.alert-block.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}

.alert-block.info {
  background: var(--brand-soft);
  border: 1px solid #c6dce5;
  color: #275e74;
  margin-bottom: 1rem;
}

.compact-alert {
  margin-bottom: 0.85rem;
}

.alert-block.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  margin-bottom: 1rem;
}

.alert-block strong,
.coverage-block summary {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.question-list {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.question-list li {
  align-items: start;
  display: flex;
  gap: 0.55rem;
}

.question-list input {
  height: 1rem;
  margin-top: 0.12rem;
  width: 1rem;
}

.coverage-block {
  background: var(--surface);
  border: 1px solid var(--line);
}

.coverage-block summary {
  cursor: pointer;
}

.coverage-block p {
  color: #3d5a6c;
  margin: 0.75rem 0 0;
  white-space: pre-wrap;
}

.run-notes {
  background: var(--surface-soft);
  border: 1px solid #e0e9ed;
  border-radius: 6px;
  color: #3d5a6c;
  padding: 0.8rem;
}

.run-notes p {
  margin: 0.4rem 0;
}

.run-notes ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.loading-overlay {
  align-items: center;
  background: rgb(23 33 43 / 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 20;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-box {
  align-items: center;
  background: var(--surface);
  border-radius: 7px;
  box-shadow: 0 16px 48px rgb(24 43 58 / 0.22);
  color: var(--ink);
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  max-width: 360px;
  padding: 1.4rem;
  text-align: center;
}

.loading-box span {
  color: var(--muted);
}

.spinner {
  animation: spin 0.8s linear infinite;
  border: 3px solid #d9e8ed;
  border-top-color: var(--brand);
  border-radius: 999px;
  height: 2rem;
  width: 2rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .topbar,
  .topbar-tools,
  .topbar-tools form,
  .brand-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 1rem;
    padding: 1rem;
  }

  .topbar-tools {
    align-self: stretch;
    justify-content: space-between;
  }

  .shell {
    padding: 1.25rem 1rem;
  }

  .workspace-intro {
    padding-top: 1rem;
  }

  .workspace-intro h1 {
    font-size: 2rem;
  }

  .inline-form,
  .row-card,
  .project-link,
  .heading-row {
    align-items: stretch;
    flex-direction: column;
  }

  .two {
    grid-template-columns: 1fr;
  }

  .table-row {
    align-items: start;
    grid-template-columns: 1fr;
  }

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

  .results-header {
    align-items: stretch;
    flex-direction: column;
  }

  .results-actions {
    justify-content: flex-start;
  }

  .testcase-row summary {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr) 1.2rem;
  }

  .case-id,
  .type-badge,
  .priority-badge,
  .review-count {
    grid-column: 2;
  }

  .chevron {
    grid-column: 3;
    grid-row: 1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .list-heading {
    display: none;
  }
}
