/* QPal Mock Board History: compact summary, centered table headings,
   structured completion details, and permanent-clear confirmation. */

.qpal-mock-history-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.qpal-mock-history-clear-button {
  align-self: start;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--border-subtle));
  border-radius: 12px;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
}

.qpal-mock-history-clear-button:hover:not(:disabled),
.qpal-mock-history-clear-button:focus-visible {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-muted));
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.qpal-mock-history-clear-button:disabled {
  cursor: default;
  opacity: .52;
}

.qpal-mock-history-summary {
  gap: 8px;
}

.qpal-mock-history-summary article {
  min-height: 58px;
  padding: 9px 11px;
  border-radius: 13px;
}

.qpal-mock-history-summary span {
  font-size: 9px;
  letter-spacing: .055em;
}

.qpal-mock-history-summary strong {
  margin-top: 2px;
  font-size: 20px;
  line-height: 1;
}

.qpal-mock-history-table-head span,
.qpal-mock-history-table-head span:last-child {
  text-align: center;
}

.qpal-mock-history-completed {
  gap: 2px;
}

.qpal-mock-history-completed .qpal-mock-history-date {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.qpal-mock-history-time {
  color: var(--text-primary);
  font-size: 9px;
  font-weight: 750;
  line-height: 1.25;
}

.qpal-mock-history-elapsed::before {
  content: "Elapsed: ";
}

.qpal-mock-history-clear-overlay {
  position: fixed;
  inset: 0;
  z-index: 5400;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(5, 4, 3, .72);
  backdrop-filter: blur(10px) saturate(90%);
  -webkit-backdrop-filter: blur(10px) saturate(90%);
}

.qpal-mock-history-clear-dialog {
  width: min(100%, 390px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-dialog), var(--inner-highlight);
  text-align: left;
}

.qpal-mock-history-clear-dialog h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.qpal-mock-history-clear-dialog p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}

.qpal-mock-history-clear-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.qpal-mock-history-clear-actions button {
  min-height: 44px;
  padding: 10px 13px;
  color: var(--text-primary);
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.qpal-mock-history-clear-actions button.is-destructive {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.qpal-mock-history-clear-actions button:hover,
.qpal-mock-history-clear-actions button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .qpal-mock-history-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "back spacer clear"
      "copy copy copy";
    gap: 12px 10px;
  }

  .qpal-mock-history-header .back-dash-btn {
    grid-area: back;
  }

  .qpal-mock-history-header > div {
    grid-area: copy;
  }

  .qpal-mock-history-clear-button {
    grid-area: clear;
  }

  .qpal-mock-history-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qpal-mock-history-summary article {
    min-height: 54px;
    padding: 8px 7px;
  }

  .qpal-mock-history-summary span {
    font-size: 7.5px;
  }

  .qpal-mock-history-summary strong {
    font-size: 18px;
  }
}

@media (max-width: 350px) {
  .qpal-mock-history-clear-button {
    padding-inline: 9px;
    font-size: 9px;
  }

  .qpal-mock-history-summary span {
    font-size: 7px;
  }

  .qpal-mock-history-summary strong {
    font-size: 17px;
  }
}
