/* Last-resort error screen (design §3.7). Tenant-neutral / brand-appropriate — not GBO green. */
.bifrost-lasterror {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #f4f5f7;
  color: #1f2733;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-y: auto;
}

.bifrost-lasterror__card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  max-width: 560px;
  width: 100%;
  padding: 32px;
  box-sizing: border-box;
}

.bifrost-lasterror__title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.bifrost-lasterror__subtitle {
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.8;
  margin-bottom: 20px;
}

.bifrost-lasterror__id {
  font-size: 13px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background: #f0f2f5;
  border-radius: 6px;
  display: inline-block;
}

.bifrost-lasterror__id-label {
  opacity: 0.7;
}

.bifrost-lasterror__id-value {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bifrost-lasterror__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.bifrost-lasterror__btn {
  appearance: none;
  border: 1px solid #d3d8de;
  background: #ffffff;
  color: #1f2733;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bifrost-lasterror__btn:hover {
  background: #f0f2f5;
}

.bifrost-lasterror__btn--primary {
  background: #1f2733;
  border-color: #1f2733;
  color: #ffffff;
}

.bifrost-lasterror__btn--primary:hover {
  background: #333f4f;
}

.bifrost-lasterror__details-wrap {
  margin-bottom: 16px;
}

.bifrost-lasterror__toggle {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: #46586f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-bottom: 8px;
}

.bifrost-lasterror__details {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  background: #1f2733;
  color: #e4e8ee;
  padding: 14px;
  border-radius: 8px;
  max-height: 40vh;
  overflow: auto;
  margin: 0;
}

.bifrost-lasterror__secondary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.bifrost-lasterror__link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  color: #2563a8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.bifrost-lasterror__link:hover {
  text-decoration: underline;
}

@media (prefers-color-scheme: dark) {
  .bifrost-lasterror {
    background: #14181d;
    color: #e4e8ee;
  }
  .bifrost-lasterror__card {
    background: #1f252c;
  }
  .bifrost-lasterror__id {
    background: #2a323b;
  }
  .bifrost-lasterror__btn {
    background: #2a323b;
    border-color: #3a444f;
    color: #e4e8ee;
  }
  .bifrost-lasterror__btn:hover {
    background: #333f4a;
  }
  .bifrost-lasterror__btn--primary {
    background: #e4e8ee;
    border-color: #e4e8ee;
    color: #1f2733;
  }
}
