/* Terminal-style output for reports */

pre code.language-gherkin.report {
  white-space: pre-wrap;
  padding: 1rem;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Fira Code', monospace;
}
.gherkin-line {
  color: var(--theme-muted, #aaa);
  font-style: italic;
}

.gherkin-success {
  color: var(--theme-success, #00ff88);
  font-weight: bold;
}

.gherkin-fail {
  color: var(--theme-danger, #ff5555);
  font-weight: bold;
}
.gherkin-skip {
  color: var(--theme-warning, #ffff55);
  font-weight: bold;
}
/*  html report table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto; /* let columns expand based on content */
}

.report-table th,
.report-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ws-line, #2d3b4e);
  white-space: nowrap;   /* remove if you want wrapping */
}

.report-table td a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere; /* allow breaking long hashes/links */
  text-decoration: none;
  color: var(--theme-text, #c1d7f5);
}

.report-table td a:hover {
  text-decoration: underline;
}
/* -----------------------------
 * Activity tab (modern/mobile)
 * ----------------------------- */

.activity-panel {
  background: var(--ws-panel, #141c29);
  border: 1px solid var(--ws-line, #2d3b4e);
  border-radius: 14px;
  overflow: hidden;
}

.activity-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.activity-address {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(520px, 100%);
  flex: 1 1 auto;
}

.activity-label {
  font-weight: 700;
  letter-spacing: 0.2px;
  opacity: 0.9;
}

.activity-account {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--theme-surface-alt, rgba(0, 0, 0, 0.25));
  border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.10));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.activity-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.activity-select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ws-line, #2d3b4e);
  background: var(--ws-input, #0d1420);
  color: var(--ws-text, inherit);
  font-size: 14px;
  line-height: 1;
}

.activity-btn {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ws-line, #2d3b4e);
  background: var(--ws-raised, #1b2637);
  color: var(--ws-text, inherit);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.05s ease;
}

.activity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.activity-iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ws-line, #2d3b4e);
  background: var(--ws-raised, #1b2637);
  color: var(--ws-text, inherit);
  cursor: pointer;
}

.activity-iconbtn:active,
.activity-btn:active {
  transform: translateY(1px);
}

.activity-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--ws-input, #0d1420);
  border: 1px solid var(--ws-line, #2d3b4e);
  margin-bottom: 10px;
}

.activity-left {
  min-width: 84px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-time {
  font-size: 12px;
  opacity: 0.75;
}

.activity-badge {
  width: fit-content;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--ws-line, #2d3b4e);
  background: var(--ws-panel, #141c29);
  opacity: 0.95;
}

.activity-main {
  flex: 1 1 auto;
  min-width: 0;
}

.activity-title {
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  font-size: 14px;
}

.activity-meta {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.activity-link {
  text-decoration: none;
  border-bottom: 1px solid var(--theme-border, rgba(255, 255, 255, 0.25));
}

.activity-link:hover {
  border-bottom-color: var(--theme-link, rgba(255, 255, 255, 0.7));
}

.activity-pager {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}

.activity-pagerinfo {
  opacity: 0.75;
  font-size: 12px;
}

@media (max-width: 600px) {
  .activity-panel { padding: 10px; }
  .activity-filters { width: 100%; justify-content: flex-start; }
  .activity-select, .activity-btn { flex: 1 1 auto; }
  .activity-left { min-width: 70px; }
}
.activity-tx-table {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--ws-line, #2d3b4e);
  display: grid;
  gap: 6px;
}

.activity-tx-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  font-size: 12px;
}

.tx-key {
  opacity: 0.6;
  font-weight: 600;
}

.tx-value {
  font-family: ui-monospace, monospace;
  word-break: break-all;
  opacity: 0.9;
}
.activity-details {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--ws-line, #2d3b4e);
}

.activity-details-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ws-line, #2d3b4e);
  background: var(--ws-raised, #1b2637);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.activity-details-toggle:active {
  transform: translateY(1px);
}

.activity-details-toggle .chev {
  opacity: 0.8;
  font-size: 12px;
}

.activity-details-body {
  margin-top: 8px;
  display: none;
}

.activity-details-body.open {
  display: block;
}

.activity-tx-table {
  display: grid;
  gap: 6px;
}

.activity-tx-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  font-size: 12px;
}

.tx-key {
  opacity: 0.6;
  font-weight: 600;
}

.tx-value {
  font-family: ui-monospace, monospace;
  word-break: break-all;
  opacity: 0.9;
}

.activity-details-loading {
  opacity: 0.7;
  font-size: 12px;
  padding: 8px 0;
}
/* -----------------------------------
 * Shared Address/Contract Tag Filter
 * (used by activity + gallery)
 * ----------------------------------- */

.addr-tags{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--theme-border, rgba(255,255,255,.10));
  background: var(--theme-surface-alt, rgba(0,0,0,.25));
  min-height: 54px;
}

.addr-tag{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--theme-border, rgba(255,255,255,.10));
  background: var(--theme-surface, rgba(255,255,255,.06));
  color: var(--theme-text, #cfd6e4);
  cursor: pointer;
  user-select: none;
  max-width: 100%;
}

.addr-tag:hover{
  border-color: var(--theme-link, rgba(255,255,255,.18));
  background: var(--theme-accent-soft, rgba(255,255,255,.08));
}

.addr-tag[aria-pressed="true"]{
  border-color: var(--theme-link, rgba(0,191,255,.55));
  background: var(--theme-accent-soft, rgba(0,191,255,.12));
  color: var(--theme-text, #ffffff);
  box-shadow: 0 0 0 2px var(--theme-shadow, rgba(0,191,255,.12)) inset;
}

.addr-tag__label{
  font-weight: 700;
  font-size: .85rem;
  color: inherit;
  flex: 0 0 auto;
}

.addr-tag__addr{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  opacity: .95;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 420px;
}

.addr-tag__x{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: .7;
  font-size: .95rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 6px;
}

.addr-tag__x:hover{
  opacity: 1;
  background: var(--theme-accent-soft, rgba(255,255,255,.08));
}

.addr-add{
  display:flex;
  gap: 10px;
  align-items: center;
}

.addr-add__input{
  width: 100%;
  padding: .75rem .85rem;
  border-radius: 10px;
  border: 1px solid var(--theme-control-border, rgba(255,255,255,.12));
  background: var(--theme-input, rgba(0,0,0,.25));
  color: var(--theme-text, #eee);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* invalid input */
.invalid{
  outline: 2px solid var(--theme-danger, rgba(255, 85, 85, .75));
  border-color: var(--theme-danger, rgba(255, 85, 85, .55)) !important;
}

/* -----------------------------------
 * Activity filter layout refinement
 * ----------------------------------- */

.activity-filters{
  /* previously row; now a compact stacked panel */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  flex: 1 1 520px;
  min-width: min(520px, 100%);
}

.activity-filters .addr-tags{
  width: 100%;
}

@media (max-width: 600px){
  .activity-filters{ min-width: 100%; }
  .addr-tag__addr{ max-width: 240px; }
  .addr-add{ flex-direction: column; align-items: stretch; }
}

.damage-dashboard .activity-panel .activity-toolbar { margin: 0; }
.damage-dashboard .activity-filters { justify-content: flex-start; width: 100%; }
.damage-dashboard .activity-filters > strong { color: var(--ws-text); font-size: 12px; }
.damage-dashboard .activity-filters .addr-tags { flex: 1 1 240px; }
.damage-dashboard .activity-filters .addr-add { display: flex; gap: 8px; flex: 1 1 360px; }
.damage-dashboard .activity-filters .addr-add__input { flex: 1 1 auto; }
.damage-dashboard .activity-list { padding: 0 14px; }
.damage-dashboard .activity-item { border-radius: 10px; }
.damage-dashboard .activity-pager { padding: 0 14px 14px; }
@media (max-width: 600px) {
  .damage-dashboard .activity-panel { padding: 0; }
  .damage-dashboard .activity-filters .addr-add { flex-basis: 100%; }
}

/* Run history uses the dashboard shell directly: no inset cards or legacy frames. */
.damage-dashboard .run-history { width: 100%; max-width: none; }
.damage-dashboard .activity-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.damage-dashboard .activity-heading > .workspace-button { flex-shrink: 0; }
.damage-dashboard .history-content { min-width: 0; background: transparent; }
.damage-dashboard .history-scopes {
  display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 20px;
  padding: 0; background: transparent; border: 0; border-bottom: 1px solid var(--ws-line);
}
.damage-dashboard .history-scopes button {
  appearance: none; flex: 0 1 auto; min-height: 40px; padding: 9px 12px 11px;
  margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--ws-muted); background: transparent; font: inherit; cursor: pointer;
}
.damage-dashboard .history-scopes button:hover { color: var(--ws-text); background: transparent; }
.damage-dashboard .history-scopes button[aria-pressed="true"] {
  background: transparent; border-color: var(--ws-accent); color: var(--ws-text); font-weight: 650;
}
.damage-dashboard .history-scopes button:focus-visible,
.damage-dashboard .run-history button:focus-visible,
.damage-dashboard .run-history input:focus-visible,
.damage-dashboard .run-history select:focus-visible,
.damage-dashboard .history-directory-toggle:focus-visible {
  outline: 2px solid var(--ws-accent); outline-offset: 2px;
}
.damage-dashboard .history-controls { margin: 0 0 18px; padding: 0 0 20px; border-bottom: 1px solid var(--ws-line); }
.damage-dashboard .history-targets { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 16px; }
.damage-dashboard .history-targets > .history-field:first-child { flex: 1 1 290px; }
.damage-dashboard .history-targets > .history-field:last-child { flex: 1 1 290px; }
.damage-dashboard .history-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.damage-dashboard .history-advanced { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 12px; }
.damage-dashboard .history-advanced .history-field { flex: 1 1 180px; }
.damage-dashboard .history-advanced .history-field:first-child { flex-grow: 2; }
.damage-dashboard .history-advanced .history-page-size { flex-grow: 0; flex-basis: 145px; }
.damage-dashboard .history-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.damage-dashboard .history-field label { font-size: 12px; font-weight: 650; color: var(--ws-muted); }
.damage-dashboard .history-field :is(input, select),
.damage-dashboard .history-directory-search input {
  width: 100%; min-width: 0; height: 40px; padding: 8px 10px;
  color: var(--ws-text); background: var(--ws-input);
  border: 1px solid var(--ws-line); border-radius: 7px; box-shadow: none; font-size: 13px;
}
.damage-dashboard .history-field select option { background: var(--ws-input); color: var(--ws-text); }
.damage-dashboard .history-inline { display: flex; gap: 8px; align-items: center; min-width: 0; }
.damage-dashboard .history-inline input { min-width: 0; flex: 1 1 auto; }
.damage-dashboard .history-inline .workspace-button { white-space: nowrap; min-height: 40px; }
.damage-dashboard .run-history .workspace-muted { font-size: 12px; }
.damage-dashboard #activity-filter-hint { margin: 10px 0 0; }
.damage-dashboard .history-results-head { margin: 20px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.damage-dashboard .history-results-head h2 { font-size: 15px; margin: 0; line-height: 1.3; }
.damage-dashboard .history-results-head p { margin: 5px 0 0; color: var(--ws-muted); font-size: 12px; }
.damage-dashboard .history-count { color: var(--ws-muted); font-size: 12px; white-space: nowrap; }
.damage-dashboard .run-history .activity-list { list-style: none; padding: 0; margin: 0; }
.damage-dashboard .run-history .activity-item {
  background: transparent; border: 0; border-bottom: 1px solid var(--ws-line); border-radius: 0;
  margin: 0; padding: 17px 0; gap: 22px;
}
.damage-dashboard .run-history .activity-item:first-child { border-top: 1px solid var(--ws-line); }
.damage-dashboard .run-history .activity-left { flex: 0 0 130px; }
.damage-dashboard .run-history .activity-time { font-size: 11px; }
.damage-dashboard .run-history .activity-title { font-size: 15px; color: var(--ws-text); }
.damage-dashboard .history-status { font-size: 11px; border-radius: 5px; padding: 3px 8px; border: 1px solid var(--theme-border, #3c4959); color: var(--theme-text, #d2dbe8); width: fit-content; }
.damage-dashboard .history-status.passed { color: var(--theme-success, #c9efb3); background: var(--theme-surface, #213628); border-color: var(--theme-border, #395d3c); }
.damage-dashboard .history-status.failed { color: var(--theme-danger, #ffc5c5); background: var(--theme-surface, #40292d); border-color: var(--theme-border, #68434b); }
.damage-dashboard .history-run-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.damage-dashboard .history-run-tags span { background: var(--theme-surface, #202f41); border-radius: 4px; color: var(--theme-text, #bcd5f5); padding: 2px 6px; font: 11px/1.4 ui-monospace, monospace; }
.damage-dashboard .run-history .activity-meta { margin-top: 10px; }
.damage-dashboard .activity-details summary { cursor: pointer; color: var(--ws-muted); font-size: 12px; }
.damage-dashboard .history-run-details { display: grid; grid-template-columns: minmax(80px, 140px) minmax(0, 1fr); gap: 4px 10px; font-size: 12px; margin: 12px 0 0; }
.damage-dashboard .history-run-details dt { color: var(--ws-muted); }
.damage-dashboard .history-run-details dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.damage-dashboard .history-empty { list-style: none; padding: 28px 0; color: var(--ws-muted); background: transparent; border: 0; }
.damage-dashboard .run-history .activity-pager { padding: 0; margin: 14px 0 18px; }
.damage-dashboard .run-history .workspace-button:disabled { opacity: .45; cursor: wait; }
/* The registry is an optional disclosure below the primary results, not a dashboard within a dashboard. */
.damage-dashboard .history-directory { margin: 24px 0 0; padding: 0; background: transparent; border: 0; border-top: 1px solid var(--ws-line); border-radius: 0; }
.damage-dashboard .history-directory-toggle {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px;
  padding: 16px 0; cursor: pointer; color: var(--ws-text); font-size: 13px;
}
.damage-dashboard .history-directory-toggle span { font-weight: 650; }
.damage-dashboard .history-directory-toggle small { font-size: 12px; color: var(--ws-muted); }
.damage-dashboard .history-directory-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.damage-dashboard .history-directory h2 { font-size: 14px; margin: 0; line-height: 1.3; }
.damage-dashboard .history-directory p { margin: 5px 0 12px; color: var(--ws-muted); font-size: 12px; }
.damage-dashboard .history-directory-search { max-width: 780px; }
.damage-dashboard #activity-registry-status { margin: 8px 0 0; }
.damage-dashboard .history-node-results { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.damage-dashboard .history-node { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ws-line); }
.damage-dashboard .history-node:last-child { border: 0; }
.damage-dashboard .history-node-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.damage-dashboard .history-node-info strong { font-size: 13px; overflow-wrap: anywhere; }
.damage-dashboard .history-node-info code { font-size: 11px; color: var(--ws-muted); }
.damage-dashboard .history-node-info small { color: var(--ws-muted); }
.damage-dashboard .history-node-actions { display: flex; gap: 7px; flex-shrink: 0; }
.damage-dashboard .history-node-actions button { font-size: 12px; min-height: 36px; }
.damage-dashboard .history-view-account { font-size: 11px; padding: 4px 8px; min-height: 28px; }
.damage-dashboard #activity-account-known { margin-top: 8px; }
.damage-dashboard #activity-account-field { flex: 1 1 100%; max-width: 740px; }
.damage-dashboard #activity-account-field input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 960px) {
  .damage-dashboard .history-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .damage-dashboard .history-scopes { gap: 2px; }
  .damage-dashboard .history-scopes button { padding-inline: 8px; flex-grow: 1; font-size: 12px; }
  .damage-dashboard .history-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .damage-dashboard .run-history .activity-item { flex-direction: column; gap: 8px; }
  .damage-dashboard .run-history .activity-left { flex: 0 0 auto; flex-direction: row; align-items: center; justify-content: space-between; }
  .damage-dashboard .history-inline { flex-wrap: wrap; }
  .damage-dashboard .history-inline .workspace-button { flex: 1 1 100px; }
}
