/* Report summary: run header and status overview (verdict, notices) */

/* --- Run header --- */
.report-dashboard__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-md);
  padding: var(--space-md) 0 var(--space-sm);
}

.report-dashboard__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.report-dashboard__domain {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-dashboard__arrow {
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.report-dashboard__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
}

/* Download is the primary action. Its icon is drawn in CSS because the export
   wiring replaces the label text while saving. */
.report-dashboard__download {
  gap: var(--space-xs);
}

.report-dashboard__download::before {
  content: '';
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v8M4.5 6.5 8 10l3.5-3.5M2.5 13.5h11'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v8M4.5 6.5 8 10l3.5-3.5M2.5 13.5h11'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Run again and New comparison are quiet text links beside it. */
.report-dashboard__link {
  min-height: 36px;
  padding: 0 var(--space-xs);
  background: none;
  border: none;
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-primary);
  cursor: pointer;
}

.report-dashboard__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-dashboard__link:disabled {
  color: var(--color-text-secondary);
  cursor: default;
  text-decoration: none;
}

.report-dashboard__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Phone: Download takes its own row and the two text actions share the
   next, instead of "New comparison" wrapping alone onto a third line. */
@media (max-width: 767px) {
  .report-dashboard__actions {
    width: 100%;
  }
  .report-dashboard__actions #export-btn-slot {
    flex-basis: 100%;
  }
  .report-dashboard__actions #export-btn-slot > * {
    width: 100%;
  }
}

.report-dashboard__meta {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

/* --- Status overview --- */
.status-overview {
  margin: var(--space-md) 0 var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.status-overview--broken {
  --status-tone: var(--color-error);
}
.status-overview--changed {
  --status-tone: var(--color-warning);
}
.status-overview--couldnt {
  --status-tone: var(--color-text-secondary);
}
.status-overview--matched {
  --status-tone: var(--color-success);
}

.status-overview__label {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
}

/* A tone dot beside the label instead of a coloured border; the label text says the same. */
.status-overview__label::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: var(--space-xs);
  border-radius: var(--radius-full);
  background: var(--status-tone, var(--color-text-secondary));
  vertical-align: 0.05em;
}

.status-overview__headline {
  margin: 0 0 var(--space-md);
  font-size: var(--text-2xl, 1.5rem);
  font-weight: var(--font-semibold);
  line-height: 1.25;
}

.status-overview__detail {
  font-weight: var(--font-normal, 400);
  color: var(--color-text-secondary);
}

/* --- Notices --- */
.status-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
}

.status-notice__icon {
  flex-shrink: 0;
  line-height: 1.4;
}

/* The whole-site offer is an invitation, not a warning. */
.status-notice--wholesite {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

.status-notice--wholesite .status-notice__icon {
  display: none;
}

.status-notice__body {
  flex: 1 1 14rem;
  min-width: 0;
}

.status-notice__hint {
  margin-top: var(--space-xs);
  color: var(--color-text-secondary);
}

.status-notice__action {
  align-self: center;
  color: var(--color-primary);
  text-decoration: underline;
  white-space: nowrap;
}

.status-notice__dismiss {
  min-width: 44px;
  min-height: 44px;
  margin: calc(var(--space-sm) * -1) calc(var(--space-sm) * -1) calc(var(--space-sm) * -1) 0;
  background: none;
  border: none;
  font-size: var(--text-xl);
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.status-notice__dismiss:hover {
  color: var(--color-text);
}

/* The marketing tagline header is not shown on the results view. */
.header--hidden {
  display: none;
}

@media (max-width: 480px) {
  .status-overview__headline {
    font-size: var(--text-xl);
  }
}

/* --- Filter bar: a compact toolbar at the top of the results panel --- */
/* Outcome tabs: underlined when active, a count badge on each. */
.fbar__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-xs);
  padding: 0 var(--space-md);
}

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 40px;
  padding: 0 var(--space-sm);
  margin-bottom: -1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.fchip--on {
  border-bottom-color: var(--color-primary);
  color: var(--color-text);
  font-weight: var(--font-semibold);
}

.fchip__count {
  min-width: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--radius-full);
  background: var(--color-input-bg);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1.25rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.fbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md) var(--space-xs);
}

.filter__search,
.filter__sort,
.filter__check {
  height: 32px;
  padding: 0 var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-raised);
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
}

.filter__search {
  flex: 1 1 200px;
  min-width: 0;
}

.fchip:focus-visible,
.filter__search:focus-visible,
.filter__sort:focus-visible,
.filter__check:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Tolerance sits at the end of the toolbar row. */
.fbar__tol {
  margin-left: auto;
}

.filter__threshold {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.filter__threshold-input {
  width: 96px;
  accent-color: var(--color-primary);
}

.filter__threshold-value {
  min-width: 3em;
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.fbar .filter__threshold-reset {
  min-height: 0;
  padding: 0.125rem var(--space-xs);
  font-size: var(--text-sm);
}

/* A one-page report keeps only the tolerance control. */
.fbar--single .filter__search,
.fbar--single .filter__check,
.fbar--single .filter__sort,
.fbar--single .fbar__tabs {
  display: none;
}

/* Phone: the outcome tabs scroll sideways instead of wrapping onto a second
   row, so the toolbar does not push the first result off the screen. */
@media (max-width: 767px) {
  .fbar__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .fchip {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Touch screens keep 44px targets. */
@media (pointer: coarse) {
  .fchip {
    min-height: 44px;
  }
  .filter__search,
  .filter__sort,
  .filter__check {
    height: 44px;
  }
}
